detect which handle is being held

This commit is contained in:
2026-06-14 16:55:04 -04:00
parent 6a0df8a49a
commit f04a9956ff
3 changed files with 16 additions and 13 deletions
+14 -1
View File
@@ -57,8 +57,21 @@ document.body.addEventListener("mouseup", () => {
// handle anchors
resize_anchors = document.getElementsByClassName("resize_anchor");
var handleBeingHeld = [false, false, false, false];
for (var i = 0; i < resize_anchors.length; i++) {
resize_anchors[i].addEventListener("mousedown", (e) => {
const index = i;
resize_anchors[index].addEventListener("mousedown", (e) => {
e.stopPropagation();
handleBeingHeld[index] = true;
});
document.body.addEventListener("mouseup", () => {
handleBeingHeld[index] = false;
});
}
document.body.addEventListener("mousemove", () => {
for (var i = 0; i < handleBeingHeld.length; i++) {
if (!handleBeingHeld[i]) continue;
}
});
+1 -12
View File
@@ -180,18 +180,7 @@
#resize_photo_box {
background-color: rgba(0, 0, 0, 0);
width: 350px;
aspect-ratio: 1 / 1;
border-style: dashed;
border-color: black;
border-width: 5px;
z-index: 4;
}
#resize_photo_box:hover {
background-color: rgba(0, 0, 0, 0);
width: 350px;
width: var(--size);
aspect-ratio: 1 / 1;
border-style: dashed;