Hop Web icons can't be selected or moved up
@@ -111,7 +111,6 @@ const handleEvent = function (event) {
// If we're not dragging the cursor with the mouse
//
- if (dx > 0 || dy > 0) {
// Clear the canvas, regardless of what happens below
//
gc.rect(0, 0, gc.canvas.width / magnification, gc.canvas.height / magnification);
@@ -152,17 +151,16 @@ const handleEvent = function (event) {
let rw = Math.abs(dx);
let rh = Math.abs(dy);
if (dx < 0) {
- rx-=dx;
+ rx += dx;
}
if (dy < 0) {
- ry-=dy;
+ ry += dy;
}
gc.setLineDash([5, 15]);
gc.rect(fx(rx), fy(ry), rw * magnification, rh * magnification);
gc.stroke();
gc.setLineDash([]);
}
- }
// Put the font right back where it was.
//
@@ -278,10 +276,16 @@ function drawNotes(notes, gc, mode, dx, dy) {
}
function fx(x) {
+ if (x<0) {
+ return 0;
+ }
return (x + offsetX) * magnification + offsetX;
}
function fy(y) {
+ if (y<0) {
+ return 0;
+ }
return (y + offsetY) * magnification + offsetY;
}
