update blobs
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user