Skip to content

Commit

Permalink
minor improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
saliherdemk committed Oct 18, 2024
1 parent 042bfbd commit 75660dc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
13 changes: 9 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,13 @@ <h3>Grada</h3>
height="20"
/>
</div>
<div id="disable-background" onclick="closeEdit()">
<div id="canvas-parent" onclick="event.stopPropagation()">
<div
id="disable-background"
onclick="closeEdit()"
onmouseover="disableCanvas()"
onmouseout="enableCanvas()"
>
<div id="canvas-parent">
<div id="edit-panel">
<div id="layer-settings-container">
<div class="flex-center">
Expand Down Expand Up @@ -185,7 +190,7 @@ <h3>Grada</h3>
</div>
</div>

<div id="create-dataset-container" onclick="event.stopPropagation()">
<div id="create-dataset-container">
<div class="flex-end">
<img
id="create-dataset-close"
Expand Down Expand Up @@ -321,8 +326,8 @@ <h3>Grada</h3>

<script src="js/p5.min.js"></script>

<script src="js/script.js"></script>
<script src="js/helpers.js"></script>
<script src="js/script.js"></script>

<script src="js/Workers/flattenWorker.js"></script>
<script src="js/Workers/getMinMaxWorker.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion js/Draw/Minors/Viewers/GraphViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class GraphViewer extends Viewer {
super(x, y, 500, 300);
this.dot = new GraphDot(this, true);
this.dark = true;
this.scale = 1;
this.scale = this.data.length > 2000 ? 1 : 0.1;
this.gridRows = 20;
this.gridCols = 10;
this.buttons = [];
Expand Down
2 changes: 0 additions & 2 deletions js/Managers/canvasManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ let TWO_PI;
let MOVE;
let WAIT;
let HAND;
let FRAMECOUNT;

let atan2;
let dist;
Expand Down Expand Up @@ -45,7 +44,6 @@ class CanvasManager {
MOVE = p.MOVE;
WAIT = p.WAIT;
HAND = p.HAND;
FRAMECOUNT = p.frameCount;

atan2 = (y, x) => p.atan2(y, x);
dist = (x1, y1, x2, y2) => p.dist(x1, y1, x2, y2);
Expand Down
4 changes: 2 additions & 2 deletions js/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ let mainSketch = function (p) {
};

p.mousePressed = function () {
!editLayerOrganizer.isEnabled() && iManager.handlePress();
!mainOrganizer.isDisabled() && iManager.handlePress();
};

p.mouseDragged = function () {
!editLayerOrganizer.isEnabled() && iManager.handleDrag();
!mainOrganizer.isDisabled() && iManager.handleDrag();
};

p.mouseReleased = function () {
Expand Down
6 changes: 6 additions & 0 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,9 @@ function scaleCanvas(event) {

iManager.scaleFactor = newScaleFactor;
}

const children = getElementById("disable-background").children;

for (let child of children) {
child.addEventListener("click", (e) => e.stopPropagation());
}

0 comments on commit 75660dc

Please sign in to comment.