From 8c22855dd80342bc944a7eab2ccbf80d18319c79 Mon Sep 17 00:00:00 2001 From: zach Date: Tue, 19 May 2026 04:20:35 +0200 Subject: [PATCH] update blobs --- Modules/ClipWrapper.qml | 2 +- Modules/Wrapper.qml | 2 +- Plugins/ZShell/Blobs/blobshape.cpp | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Modules/ClipWrapper.qml b/Modules/ClipWrapper.qml index 6b735f5..6770487 100644 --- a/Modules/ClipWrapper.qml +++ b/Modules/ClipWrapper.qml @@ -24,7 +24,7 @@ Item { const diff = parent.width - Math.floor(off + content.nonAnimWidth); if (diff < 0) return off + diff; - return Math.floor(Math.max(off, 0)); + return Math.max(off, 0); } y: content.isDetached ? (parent.height - content.nonAnimHeight) / 2 : 0 diff --git a/Modules/Wrapper.qml b/Modules/Wrapper.qml index 8bf0ab7..0c25227 100644 --- a/Modules/Wrapper.qml +++ b/Modules/Wrapper.qml @@ -15,8 +15,8 @@ Item { property real currentCenter property alias currentName: popoutState.currentName property string detachedMode - readonly property bool isDetached: detachedMode.length > 0 property alias hasCurrent: popoutState.hasCurrent + readonly property bool isDetached: detachedMode.length > 0 readonly property real nonAnimHeight: children.find(c => c.shouldBeActive)?.implicitHeight ?? content.implicitHeight readonly property real nonAnimWidth: children.find(c => c.shouldBeActive)?.implicitWidth ?? content.implicitWidth required property real offsetScale diff --git a/Plugins/ZShell/Blobs/blobshape.cpp b/Plugins/ZShell/Blobs/blobshape.cpp index 85bebf2..dd33052 100644 --- a/Plugins/ZShell/Blobs/blobshape.cpp +++ b/Plugins/ZShell/Blobs/blobshape.cpp @@ -77,6 +77,26 @@ void BlobShape::geometryChange(const QRectF& newGeometry, const QRectF& oldGeome 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; + // Update cached padded values immediately so markShapeDirty() uses + // current dimensions for neighbor-finding. The values are also updated + // in updatePolish() later, but that happens after markShapeDirty() + // has already used them to find intersecting shapes. + if (isInvertedRect()) { + const QPointF scenePos = mapToScene(QPointF(0, 0)); + m_cachedPaddedX = static_cast(scenePos.x()); + m_cachedPaddedY = static_cast(scenePos.y()); + m_cachedPaddedW = static_cast(newGeometry.width()); + m_cachedPaddedH = static_cast(newGeometry.height()); + } else { + const QPointF scenePos = mapToScene(QPointF(0, 0)); + const float hw = static_cast(newGeometry.width()) * 0.5f; + const float hh = static_cast(newGeometry.height()) * 0.5f; + const float totalPad = static_cast(m_group->smoothing()) + deformPadding(m_deformMatrix, hw, hh); + m_cachedPaddedX = static_cast(scenePos.x()) - totalPad; + m_cachedPaddedY = static_cast(scenePos.y()) - totalPad; + m_cachedPaddedW = static_cast(newGeometry.width()) + 2.0f * totalPad; + m_cachedPaddedH = static_cast(newGeometry.height()) + 2.0f * totalPad; + } m_group->markShapeDirty(this); } }