update blobs

This commit is contained in:
2026-05-19 04:32:52 +02:00
parent 550630feaa
commit 76e55b01e4
3 changed files with 54 additions and 6 deletions
+25
View File
@@ -59,6 +59,20 @@ void BlobShape::setRadius(qreal r) {
m_group->markDirty();
}
void BlobShape::setTargetWidth(qreal w) {
if (qFuzzyCompare(m_targetWidth, w))
return;
m_targetWidth = w;
emit targetWidthChanged();
}
void BlobShape::setTargetHeight(qreal h) {
if (qFuzzyCompare(m_targetHeight, h))
return;
m_targetHeight = h;
emit targetHeightChanged();
}
void BlobShape::componentComplete() {
QQuickItem::componentComplete();
if (m_group)
@@ -118,6 +132,17 @@ void BlobShape::updatePolish() {
if (!m_group)
return;
// Check if target dimensions (panel size) have changed since last polish.
// This catches cases where the panel's implicit size changes but the
// BlobRect's geometry doesn't update (e.g. parent Rectangle doesn't
// respect implicit sizes), which would otherwise skip dirty marking.
if (!qFuzzyCompare(m_targetWidth, m_lastPolishTargetWidth) ||
!qFuzzyCompare(m_targetHeight, m_lastPolishTargetHeight)) {
m_lastPolishTargetWidth = m_targetWidth;
m_lastPolishTargetHeight = m_targetHeight;
m_group->markDirty();
}
// Ensure all shapes have up-to-date physics (only once per frame)
m_group->ensurePhysicsUpdated();