diff --git a/plugin/src/Caelestia/Blobs/blobshape.cpp b/plugin/src/Caelestia/Blobs/blobshape.cpp index 96662150..718c03e7 100644 --- a/plugin/src/Caelestia/Blobs/blobshape.cpp +++ b/plugin/src/Caelestia/Blobs/blobshape.cpp @@ -69,13 +69,16 @@ void BlobShape::geometryChange(const QRectF& newGeometry, const QRectF& oldGeome QQuickItem::geometryChange(newGeometry, oldGeometry); updateCenteredDeformMatrix(); if (m_group) { - // Only trigger redraw if the change is visually meaningful - const auto dx = std::abs(newGeometry.x() - oldGeometry.x()); - const auto dy = std::abs(newGeometry.y() - oldGeometry.y()); + // 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 (dx > 0.5 || dy > 0.5 || dw > 0.5 || dh > 0.5) + if (std::abs(m_pendingDx) > 0.5f || std::abs(m_pendingDy) > 0.5f || dw > 0.5 || dh > 0.5) { + m_pendingDx = 0; + m_pendingDy = 0; m_group->markShapeDirty(this); + } } } diff --git a/plugin/src/Caelestia/Blobs/blobshape.hpp b/plugin/src/Caelestia/Blobs/blobshape.hpp index c9d98504..c05a40d8 100644 --- a/plugin/src/Caelestia/Blobs/blobshape.hpp +++ b/plugin/src/Caelestia/Blobs/blobshape.hpp @@ -70,6 +70,8 @@ protected: QRectF m_localPaddedRect; QVector m_cachedRects; int m_cachedMyIndex = -2; + float m_pendingDx = 0; + float m_pendingDy = 0; bool m_cachedHasInverted = false; float m_cachedInvertedRadius = 0; float m_cachedInvertedOuter[4] = {};