move picker to main panelwindow to reduce vram usage
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user