fix blobs dirty tracking #87
@@ -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
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -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<float>(scenePos.x());
|
||||
m_cachedPaddedY = static_cast<float>(scenePos.y());
|
||||
m_cachedPaddedW = static_cast<float>(newGeometry.width());
|
||||
m_cachedPaddedH = static_cast<float>(newGeometry.height());
|
||||
} else {
|
||||
const QPointF scenePos = mapToScene(QPointF(0, 0));
|
||||
const float hw = static_cast<float>(newGeometry.width()) * 0.5f;
|
||||
const float hh = static_cast<float>(newGeometry.height()) * 0.5f;
|
||||
const float totalPad = static_cast<float>(m_group->smoothing()) + deformPadding(m_deformMatrix, hw, hh);
|
||||
m_cachedPaddedX = static_cast<float>(scenePos.x()) - totalPad;
|
||||
m_cachedPaddedY = static_cast<float>(scenePos.y()) - totalPad;
|
||||
m_cachedPaddedW = static_cast<float>(newGeometry.width()) + 2.0f * totalPad;
|
||||
m_cachedPaddedH = static_cast<float>(newGeometry.height()) + 2.0f * totalPad;
|
||||
}
|
||||
m_group->markShapeDirty(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user