This commit is contained in:
朱子楚\zhuzi
2023-03-25 13:35:21 +08:00
parent 36d7c714a5
commit a59010ec72
95 changed files with 520 additions and 383 deletions

View File

@ -1,4 +1,4 @@
import QtQuick
import QtQuick 2.15
Item {
id: root
@ -50,12 +50,20 @@ Item {
y: r
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
pickerCursor.x = Math.max(0,Math.min(mouse.x - r,width-2*r));
pickerCursor.y = Math.max(0,Math.min(mouse.y - r,height-2*r));
// pickerCursor.x = Math.max(-r,Math.min(mouse.x - r,width+r));
// pickerCursor.y = Math.max(-r,Math.min(mouse.y - r,height+r));
// pickerCursor.x = Math.max(0, Math.min(width, mouse.x) - 2 * r);
// pickerCursor.y = Math.max(0, Math.min(height, mouse.y) - 2 * r);
}
}
onPositionChanged:(mouse)=> handleMouse(mouse)
onPressed:(mouse)=> handleMouse(mouse)
onPositionChanged: handleMouse(mouse)
onPressed: handleMouse(mouse)
}
}