From d0e696c681d5c84fe1b131ee820f51c0569a8674 Mon Sep 17 00:00:00 2001 From: zach Date: Tue, 19 May 2026 04:52:28 +0200 Subject: [PATCH] update blobs --- Plugins/ZShell/Blobs/blobshape.cpp | 12 +++++++++--- Plugins/ZShell/Blobs/blobshape.hpp | 6 ++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Plugins/ZShell/Blobs/blobshape.cpp b/Plugins/ZShell/Blobs/blobshape.cpp index 85bebf2..7bcef78 100644 --- a/Plugins/ZShell/Blobs/blobshape.cpp +++ b/Plugins/ZShell/Blobs/blobshape.cpp @@ -72,11 +72,17 @@ void BlobShape::geometryChange(const QRectF& newGeometry, const QRectF& oldGeome // Accumulate sub-pixel drift so slow movements don't desync the shader m_pendingDx += static_cast(newGeometry.x() - oldGeometry.x()); m_pendingDy += static_cast(newGeometry.y() - oldGeometry.y()); - const auto dw = std::abs(newGeometry.width() - oldGeometry.width()); - const auto dh = std::abs(newGeometry.height() - oldGeometry.height()); - if (std::abs(m_pendingDx) > 0.5f || std::abs(m_pendingDy) > 0.5f || dw > 0.5 || dh > 0.5) { + // Accumulate size delta across multiple frames so incremental size + // changes that are each below the threshold still trigger a dirty + // mark once their accumulated delta exceeds it. + m_pendingDw += static_cast(newGeometry.width() - oldGeometry.width()); + m_pendingDh += static_cast(newGeometry.height() - oldGeometry.height()); + if (std::abs(m_pendingDx) > 0.5f || std::abs(m_pendingDy) > 0.5f || + std::abs(m_pendingDw) > 0.5f || std::abs(m_pendingDh) > 0.5f) { m_pendingDx = 0; m_pendingDy = 0; + m_pendingDw = 0; + m_pendingDh = 0; m_group->markShapeDirty(this); } } diff --git a/Plugins/ZShell/Blobs/blobshape.hpp b/Plugins/ZShell/Blobs/blobshape.hpp index aa1d018..cfb60f4 100644 --- a/Plugins/ZShell/Blobs/blobshape.hpp +++ b/Plugins/ZShell/Blobs/blobshape.hpp @@ -84,8 +84,10 @@ QRectF m_localPaddedRect; QVector m_cachedRects; int m_cachedMyIndex = -2; float m_pendingDx = 0; -float m_pendingDy = 0; -bool m_cachedHasInverted = false; + float m_pendingDy = 0; + float m_pendingDw = 0; + float m_pendingDh = 0; + bool m_cachedHasInverted = false; float m_cachedInvertedRadius = 0; float m_cachedInvertedOuter[4] = {}; float m_cachedInvertedInner[4] = {};