Skip to content

Commit

Permalink
add left-click to scroll and right-click to select
Browse files Browse the repository at this point in the history
  • Loading branch information
therealharshit committed Nov 21, 2024
1 parent 3ca88d2 commit fc6eaac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,7 @@ class Activity {
that.stageX = event.stageX;
that.stageY = event.stageY;

if (!moving) return;
if (!that.moving) return;

// if we are moving the block container, deselect the active block.
// Deselect active block if moving the block container
Expand Down Expand Up @@ -6062,6 +6062,8 @@ class Activity {
document.addEventListener(
"mousedown",
(event) => {
if (event.button !==2) return;
this.moving = false;
// event.preventDefault();
// event.stopPropagation();
if (event.target.id === "myCanvas") {
Expand Down Expand Up @@ -6114,6 +6116,8 @@ class Activity {

document.addEventListener("mouseup", (event) => {
// event.preventDefault();
if (event.button !== 2) return;
this.moving = true;
this.isDragging = false;
this.selectionArea.style.display = "none";
this.startX = 0;
Expand Down

0 comments on commit fc6eaac

Please sign in to comment.