Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 76e55b01e4 |
@@ -239,6 +239,8 @@ Variants {
|
|||||||
property real extraHeight: panels.popouts.isDetached ? 0 : 0.2
|
property real extraHeight: panels.popouts.isDetached ? 0 : 0.2
|
||||||
|
|
||||||
deformAmount: panels.popouts.isDetached ? 0.05 * Config.appearance.deform.scale : panels.popouts.hasCurrent ? 0.15 * Config.appearance.deform.scale : 0.1 * Config.appearance.deform.scale
|
deformAmount: panels.popouts.isDetached ? 0.05 * Config.appearance.deform.scale : panels.popouts.hasCurrent ? 0.15 * Config.appearance.deform.scale : 0.1 * Config.appearance.deform.scale
|
||||||
|
targetHeight: panels.popouts.height * (1 + extraHeight)
|
||||||
|
targetWidth: panels.popouts.width
|
||||||
implicitHeight: panels.popouts.height * (1 + extraHeight)
|
implicitHeight: panels.popouts.height * (1 + extraHeight)
|
||||||
implicitWidth: panels.popouts.width
|
implicitWidth: panels.popouts.width
|
||||||
panel: panels.popouts
|
panel: panels.popouts
|
||||||
@@ -380,6 +382,8 @@ Variants {
|
|||||||
property real deformAmount: 0.15
|
property real deformAmount: 0.15
|
||||||
required property Item panel
|
required property Item panel
|
||||||
|
|
||||||
|
targetHeight: panel.height
|
||||||
|
targetWidth: panel.width
|
||||||
deformScale: deformAmount / 10000
|
deformScale: deformAmount / 10000
|
||||||
group: blobGroup
|
group: blobGroup
|
||||||
implicitHeight: panel.height
|
implicitHeight: panel.height
|
||||||
|
|||||||
@@ -59,6 +59,20 @@ void BlobShape::setRadius(qreal r) {
|
|||||||
m_group->markDirty();
|
m_group->markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BlobShape::setTargetWidth(qreal w) {
|
||||||
|
if (qFuzzyCompare(m_targetWidth, w))
|
||||||
|
return;
|
||||||
|
m_targetWidth = w;
|
||||||
|
emit targetWidthChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BlobShape::setTargetHeight(qreal h) {
|
||||||
|
if (qFuzzyCompare(m_targetHeight, h))
|
||||||
|
return;
|
||||||
|
m_targetHeight = h;
|
||||||
|
emit targetHeightChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void BlobShape::componentComplete() {
|
void BlobShape::componentComplete() {
|
||||||
QQuickItem::componentComplete();
|
QQuickItem::componentComplete();
|
||||||
if (m_group)
|
if (m_group)
|
||||||
@@ -118,6 +132,17 @@ void BlobShape::updatePolish() {
|
|||||||
if (!m_group)
|
if (!m_group)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Check if target dimensions (panel size) have changed since last polish.
|
||||||
|
// This catches cases where the panel's implicit size changes but the
|
||||||
|
// BlobRect's geometry doesn't update (e.g. parent Rectangle doesn't
|
||||||
|
// respect implicit sizes), which would otherwise skip dirty marking.
|
||||||
|
if (!qFuzzyCompare(m_targetWidth, m_lastPolishTargetWidth) ||
|
||||||
|
!qFuzzyCompare(m_targetHeight, m_lastPolishTargetHeight)) {
|
||||||
|
m_lastPolishTargetWidth = m_targetWidth;
|
||||||
|
m_lastPolishTargetHeight = m_targetHeight;
|
||||||
|
m_group->markDirty();
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure all shapes have up-to-date physics (only once per frame)
|
// Ensure all shapes have up-to-date physics (only once per frame)
|
||||||
m_group->ensurePhysicsUpdated();
|
m_group->ensurePhysicsUpdated();
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ Q_PROPERTY(BlobGroup* group READ group WRITE setGroup NOTIFY groupChanged)
|
|||||||
Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
|
Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
|
||||||
Q_PROPERTY(QMatrix4x4 deformMatrix READ deformMatrix NOTIFY deformMatrixChanged)
|
Q_PROPERTY(QMatrix4x4 deformMatrix READ deformMatrix NOTIFY deformMatrixChanged)
|
||||||
Q_PROPERTY(QMatrix4x4 rawDeformMatrix READ rawDeformMatrix NOTIFY rawDeformMatrixChanged)
|
Q_PROPERTY(QMatrix4x4 rawDeformMatrix READ rawDeformMatrix NOTIFY rawDeformMatrixChanged)
|
||||||
|
Q_PROPERTY(qreal targetWidth READ targetWidth WRITE setTargetWidth NOTIFY targetWidthChanged)
|
||||||
|
Q_PROPERTY(qreal targetHeight READ targetHeight WRITE setTargetHeight NOTIFY targetHeightChanged)
|
||||||
|
|
||||||
friend class BlobGroup;
|
friend class BlobGroup;
|
||||||
|
|
||||||
@@ -46,6 +48,19 @@ void groupChanged();
|
|||||||
void radiusChanged();
|
void radiusChanged();
|
||||||
void deformMatrixChanged();
|
void deformMatrixChanged();
|
||||||
void rawDeformMatrixChanged();
|
void rawDeformMatrixChanged();
|
||||||
|
void targetWidthChanged();
|
||||||
|
void targetHeightChanged();
|
||||||
|
|
||||||
|
public:
|
||||||
|
qreal targetWidth() const {
|
||||||
|
return m_targetWidth;
|
||||||
|
}
|
||||||
|
void setTargetWidth(qreal w);
|
||||||
|
|
||||||
|
qreal targetHeight() const {
|
||||||
|
return m_targetHeight;
|
||||||
|
}
|
||||||
|
void setTargetHeight(qreal h);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void componentComplete() override;
|
void componentComplete() override;
|
||||||
@@ -85,6 +100,10 @@ QVector<BlobRectData> m_cachedRects;
|
|||||||
int m_cachedMyIndex = -2;
|
int m_cachedMyIndex = -2;
|
||||||
float m_pendingDx = 0;
|
float m_pendingDx = 0;
|
||||||
float m_pendingDy = 0;
|
float m_pendingDy = 0;
|
||||||
|
qreal m_targetWidth = 0;
|
||||||
|
qreal m_targetHeight = 0;
|
||||||
|
qreal m_lastPolishTargetWidth = -1;
|
||||||
|
qreal m_lastPolishTargetHeight = -1;
|
||||||
bool m_cachedHasInverted = false;
|
bool m_cachedHasInverted = false;
|
||||||
float m_cachedInvertedRadius = 0;
|
float m_cachedInvertedRadius = 0;
|
||||||
float m_cachedInvertedOuter[4] = {};
|
float m_cachedInvertedOuter[4] = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user