move picker to main panelwindow to reduce vram usage

This commit is contained in:
2026-10-04 18:20:10 +02:00
parent 5507b99fdc
commit 2c88b7abcb
9 changed files with 133 additions and 128 deletions
+7 -5
View File
@@ -59,6 +59,7 @@ Item {
}
anchors.fill: parent
enabled: tool !== "none"
StrokeCanvas {
id: canvas
@@ -77,15 +78,12 @@ Item {
acceptedButtons: Qt.LeftButton | Qt.RightButton
anchors.fill: parent
cursorShape: undefined
enabled: root.tool !== "none"
hoverEnabled: true
enabled: root.enabled
onPositionChanged: e => {
const x = e.x;
const y = e.y;
canvas.hoverPoint = Qt.point(x, y);
if (!pressed)
return;
@@ -125,12 +123,16 @@ Item {
const withinYHeight = y > root.selection.y && y < root.selection.y + root.selection.implicitHeight;
if (withinXWidth && withinYHeight) {
canvas.showHover(x, y);
if (!drawHandler.pressed)
canvas.showHover(x, y);
else
canvas.showHover(drawHandler.mouseX, drawHandler.mouseY);
return Qt.BlankCursor;
} else {
canvas.hideHover();
return undefined;
}
}
enabled: root.enabled
}
}