diff --git a/Plugins/ZShell/Blobs/blobrect.cpp b/Plugins/ZShell/Blobs/blobrect.cpp index dc03432..ea027a9 100644 --- a/Plugins/ZShell/Blobs/blobrect.cpp +++ b/Plugins/ZShell/Blobs/blobrect.cpp @@ -158,11 +158,12 @@ void BlobRect::setBottomRightRadius(qreal r) { } void BlobRect::cornerRadii(float out[4]) const { - const auto base = static_cast(m_radius); - out[0] = m_topRightRadius >= 0 ? static_cast(m_topRightRadius) : base; - out[1] = m_bottomRightRadius >= 0 ? static_cast(m_bottomRightRadius) : base; - out[2] = m_bottomLeftRadius >= 0 ? static_cast(m_bottomLeftRadius) : base; - out[3] = m_topLeftRadius >= 0 ? static_cast(m_topLeftRadius) : base; + const auto maxR = static_cast(std::min(width(), height())) * 0.5f; + const auto base = std::min(static_cast(m_radius), maxR); + out[0] = std::min(m_topRightRadius >= 0 ? static_cast(m_topRightRadius) : base, maxR); + out[1] = std::min(m_bottomRightRadius >= 0 ? static_cast(m_bottomRightRadius) : base, maxR); + out[2] = std::min(m_bottomLeftRadius >= 0 ? static_cast(m_bottomLeftRadius) : base, maxR); + out[3] = std::min(m_topLeftRadius >= 0 ? static_cast(m_topLeftRadius) : base, maxR); } bool BlobRect::isExcluded(const BlobShape* other) const { diff --git a/Plugins/ZShell/Blobs/blobshape.cpp b/Plugins/ZShell/Blobs/blobshape.cpp index d284a5e..ce05808 100644 --- a/Plugins/ZShell/Blobs/blobshape.cpp +++ b/Plugins/ZShell/Blobs/blobshape.cpp @@ -72,15 +72,11 @@ 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()); - 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) { + 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) { m_pendingDx = 0; m_pendingDy = 0; - m_pendingDw = 0; - m_pendingDh = 0; m_group->markShapeDirty(this); } } @@ -100,7 +96,8 @@ void BlobShape::updateCenteredDeformMatrix() { } void BlobShape::cornerRadii(float out[4]) const { - const auto r = static_cast(m_radius); + const auto maxR = static_cast(std::min(width(), height())) * 0.5f; + const auto r = std::min(static_cast(m_radius), maxR); out[0] = r; out[1] = r; out[2] = r; diff --git a/Plugins/ZShell/Blobs/blobshape.hpp b/Plugins/ZShell/Blobs/blobshape.hpp index f130c23..aa1d018 100644 --- a/Plugins/ZShell/Blobs/blobshape.hpp +++ b/Plugins/ZShell/Blobs/blobshape.hpp @@ -85,8 +85,6 @@ QVector m_cachedRects; int m_cachedMyIndex = -2; float m_pendingDx = 0; float m_pendingDy = 0; -float m_pendingDw = 0; -float m_pendingDh = 0; bool m_cachedHasInverted = false; float m_cachedInvertedRadius = 0; float m_cachedInvertedOuter[4] = {}; diff --git a/shell.qml b/shell.qml index 9bf3bc9..6aa0bb2 100644 --- a/shell.qml +++ b/shell.qml @@ -1,6 +1,7 @@ //@ pragma UseQApplication //@ pragma Env QSG_RENDER_LOOP=threaded // @ pragma Env QSG_RHI_BACKEND=vulkan +//@ pragma Env QSG_NO_VSYNC=1 //@ pragma Env QSG_USE_SIMPLE_ANIMATION_DRIVER=0 //@ pragma Env QS_NO_RELOAD_POPUP=1 //@ pragma Env QT_SCALE_FACTOR_ROUNDING_POLICY=Round