diff --git a/Plugins/ZShell/Blobs/blobgroup.cpp b/Plugins/ZShell/Blobs/blobgroup.cpp index 62eef10..e77cf05 100644 --- a/Plugins/ZShell/Blobs/blobgroup.cpp +++ b/Plugins/ZShell/Blobs/blobgroup.cpp @@ -85,8 +85,6 @@ void BlobGroup::markShapeDirty(BlobShape* source) { const QRectF otherRect(static_cast(shape->m_cachedPaddedX), static_cast(shape->m_cachedPaddedY), static_cast(shape->m_cachedPaddedW), static_cast(shape->m_cachedPaddedH)); if (srcRect.intersects(otherRect)) { - shape->setExpandedRect(srcRect); - shape->m_hasExpandedRect = true; shape->polish(); shape->update(); } diff --git a/Plugins/ZShell/Blobs/blobshape.cpp b/Plugins/ZShell/Blobs/blobshape.cpp index 0265da0..85bebf2 100644 --- a/Plugins/ZShell/Blobs/blobshape.cpp +++ b/Plugins/ZShell/Blobs/blobshape.cpp @@ -118,8 +118,6 @@ void BlobShape::updatePolish() { if (!m_group) return; - m_hasExpandedRect = false; - // Ensure all shapes have up-to-date physics (only once per frame) m_group->ensurePhysicsUpdated(); @@ -166,20 +164,18 @@ void BlobShape::updatePolish() { if (isExcluded(other)) continue; - const QPointF otherScene = other->mapToScene(QPointF(0, 0)); - const float otherHW = static_cast(other->width()) * 0.5f; - const float otherHH = static_cast(other->height()) * 0.5f; - const float otherPad = pad + deformPadding(other->m_deformMatrix, otherHW, otherHH); - const QRectF otherPadded(otherScene.x() - static_cast(otherPad), - otherScene.y() - static_cast(otherPad), other->width() + 2.0 * static_cast(otherPad), - other->height() + 2.0 * static_cast(otherPad)); + const QPointF otherScene = other->mapToScene(QPointF(0, 0)); bool include = false; if (isInvertedRect()) { include = true; - } else if (m_hasExpandedRect) { - include = m_expandedRect.intersects(otherPadded); } else { + const float otherHW = static_cast(other->width()) * 0.5f; + const float otherHH = static_cast(other->height()) * 0.5f; + const float otherPad = pad + deformPadding(other->m_deformMatrix, otherHW, otherHH); + const QRectF otherPadded(otherScene.x() - static_cast(otherPad), + otherScene.y() - static_cast(otherPad), other->width() + 2.0 * static_cast(otherPad), + other->height() + 2.0 * static_cast(otherPad)); include = myPadded.intersects(otherPadded); } diff --git a/Plugins/ZShell/Blobs/blobshape.hpp b/Plugins/ZShell/Blobs/blobshape.hpp index 02c18c7..aa1d018 100644 --- a/Plugins/ZShell/Blobs/blobshape.hpp +++ b/Plugins/ZShell/Blobs/blobshape.hpp @@ -67,20 +67,10 @@ virtual void updatePhysics() { } virtual void registerWithGroup(); - virtual void unregisterFromGroup(); - void updateCenteredDeformMatrix(); +virtual void unregisterFromGroup(); +void updateCenteredDeformMatrix(); - void setExpandedRect(const QRectF& rect) { - m_expandedRect = rect; - } - const QRectF& expandedRect() const { - return m_expandedRect; - } - bool hasExpandedRect() const { - return m_hasExpandedRect; - } - - BlobGroup* m_group = nullptr; +BlobGroup* m_group = nullptr; qreal m_radius = 0; QMatrix4x4 m_deformMatrix; // identity by default QMatrix4x4 m_centeredDeformMatrix; @@ -98,8 +88,5 @@ float m_pendingDy = 0; bool m_cachedHasInverted = false; float m_cachedInvertedRadius = 0; float m_cachedInvertedOuter[4] = {}; - float m_cachedInvertedInner[4] = {}; - - QRectF m_expandedRect; - bool m_hasExpandedRect = false; +float m_cachedInvertedInner[4] = {}; };