fix: closed panels don't add resistance to bounce + use qtrendering for text

This commit is contained in:
2026-10-07 13:32:37 +02:00
parent 376595cd0b
commit 909b5113fb
14 changed files with 146 additions and 81 deletions
+26 -6
View File
@@ -65,6 +65,19 @@ float smaxSharpA(float a, float b, float k) {
void main() {
vec2 pixel = vec2(paddedX, paddedY) + qt_TexCoord0 * vec2(paddedW, paddedH);
// The frame distances are needed before the per-rect pass. In the border strip the
// boundary is the frame, displaced only by the shape that is pushing, so a shape that
// is not the source must not define the boundary there. It still fills the inner area,
// so this only gates the strip, which is the bar edge.
float dOuter = 0.0;
float dInner = 0.0;
bool inStrip = false;
if (hasInverted != 0) {
dOuter = sdBox(pixel, invertedOuter.xy, invertedOuter.zw) - 1.0;
dInner = sdRoundedBox(pixel, invertedInner.xy, invertedInner.zw, invertedRadius);
inStrip = dOuter < 0.0 && dInner > 0.0;
}
// Phase 1: compute per-rect SDF, and track which rect owns the pixel for the
// per-shape path (BlobGroup). The single group draw (BlobGroup2) has no owner:
// myIndex stays -2, so the ownership test is skipped and this pass writes every
@@ -78,10 +91,17 @@ void main() {
vec4 props =
rectData[i * 5 + 1]; // excludeMask(int bits), offsetX, offsetY, minEig
vec4 invDm = rectData[i * 5 + 2]; // inverse deform matrix
vec4 sh = rectData[i * 5 + 3]; // screenHalfX, screenHalfY, 0, 0
vec4 sh = rectData[i * 5 + 3]; // screenHalfX, screenHalfY, isSource, 0
vec4 radii =
rectData[i * 5 + 4]; // effective per-corner radii (tr, br, bl, tl)
// A shape that is not pushing does not shape the bar edge, so inside the strip it
// must not add its own outline to a span another shape is already shaping.
if (inStrip && sh.z < 0.5) {
dArr[i] = 1e10;
continue;
}
// Offset center for asymmetric deformation
vec2 center = rect.xy + props.yz;
@@ -182,10 +202,6 @@ void main() {
}
if (hasInverted != 0) {
float dOuter = sdBox(pixel, invertedOuter.xy, invertedOuter.zw) - 1.0;
float dInner =
sdRoundedBox(pixel, invertedInner.xy, invertedInner.zw, invertedRadius);
// Border sinks: track the opposite rect edge, clamped to border thickness
float innerTop = invertedInner.y - invertedInner.w;
float innerBot = invertedInner.y + invertedInner.w;
@@ -198,6 +214,10 @@ void main() {
float sinkValue = 0.0;
for (int i = 0; i < rectCount; i++) {
// Only a shape that is pushing can move the border.
if (rectData[i * 5 + 3].z < 0.5)
continue;
vec4 rect = rectData[i * 5];
vec4 sinkProps = rectData[i * 5 + 1];
vec2 sinkSh = rectData[i * 5 + 3].xy;
@@ -208,7 +228,7 @@ void main() {
// Delay sink to absorb smin blend depth (cubic smin max = k/6)
float preOff = smoothFactor * (1.0 / 6.0);
// Top border: track rect's BOTTOM edge, only within border thickness
// Top border: track rect's BOTTOM edge, clamped to border thickness
float topPen = clamp(innerTop - (ctr.y + sinkSh.y) - preOff, 0.0,
innerTop - outerTop);