avoid unnecessary JS bindings by using narrower conditions, remove logging

This commit is contained in:
2026-05-27 13:05:45 +02:00
parent d92e5b4cd7
commit 41c9d9e9b4
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -23,6 +23,7 @@ Canvas {
ctx.save(); ctx.save();
ctx.lineWidth = root.penWidth; ctx.lineWidth = root.penWidth;
ctx.strokeStyle = root.penColor; ctx.strokeStyle = root.penColor;
ctx.lineJoin = "round";
ctx.lineCap = "round"; ctx.lineCap = "round";
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(points[0].x, points[0].y); ctx.moveTo(points[0].x, points[0].y);
+2 -2
View File
@@ -32,10 +32,10 @@ CustomMouseArea {
if (root.visibilities.isDrawing && (event.buttons & Qt.LeftButton)) { if (root.visibilities.isDrawing && (event.buttons & Qt.LeftButton)) {
root.drawing.points.push(Qt.point(x, y)); root.drawing.points.push(Qt.point(x, y));
root.drawing.requestPaint(); root.drawing.requestPaint();
return;
} }
if (root.inLeftPanel(root.popout, x, y)) { if (!(event.buttons & Qt.LeftButton) && root.inLeftPanel(root.popout, x, y)) {
console.log("set -2 z");
root.z = -2; root.z = -2;
root.panels.drawing.expanded = true; root.panels.drawing.expanded = true;
} }