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
+27 -2
View File
@@ -189,6 +189,9 @@ void BlobGroup2::ensureDataBuilt() {
const int count = static_cast<int>(m_data.rects.size());
// Which shape is the source for the bar edge.
resolveSources(entryShapes);
// Exclusion gates only the smooth blend.
for (int i = 0; i < count; ++i) {
int mask = 0;
@@ -251,8 +254,8 @@ void BlobGroup2::ensureDataBuilt() {
ri.radius[3] = std::max(ri.radius[3] * fTl, minR);
}
// Inverted rect. The frame term is evaluated for every pixel in the bounds,
// so the group flag cannot be gated per shape.
// Inverted rect. The frame term is evaluated for every pixel in the bounds, so the
// group flag cannot be gated per shape.
if (!m_invertedRect) return;
auto* inv = static_cast<BlobShape2*>(m_invertedRect);
@@ -299,6 +302,28 @@ void BlobGroup2::ensureDataBuilt() {
2.0 * (static_cast<double>(outerHH) + extent)));
}
// A point on the bar edge can only have one source. A shape that is not pushing is not
// the source: it still fills its own area, but inside the border strip it must not add
// its own outline to a span another shape is already shaping. That is the case that
// matters — one panel at rest next to one that is bouncing — where the edge showed
// several steps instead of one smooth indent of the closing panel. Only one shape can be
// pushing at a time, so the flag is just that, and the shader gates the strip with it.
void BlobGroup2::resolveSources(const QVector<BlobShape2*>& entryShapes) {
const int count = static_cast<int>(m_data.rects.size());
// With nothing pushing there is no span being shaped, so a shape at rest keeps its
// own outline and nothing is gated.
bool anyPushing = false;
for (int i = 0; i < count; ++i)
if (entryShapes[i]->isMoving()) {
anyPushing = true;
break;
}
for (int i = 0; i < count; ++i)
m_data.rects[i].source = !anyPushing || entryShapes[i]->isMoving();
}
void BlobGroup2::fillMaterial(BlobMaterial* material) {
material->m_paddedX = static_cast<float>(m_bounds.x());
material->m_paddedY = static_cast<float>(m_bounds.y());