Skip to content

Commit

Permalink
Simplify realiseMouseMovement functions further
Browse files Browse the repository at this point in the history
  • Loading branch information
jrie committed Dec 28, 2024
1 parent a1c01bf commit 8994529
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/canTop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1283,8 +1283,8 @@ function canTop (canvasItem, designName, useBackground, width, height, gridX, gr

// Maximum positive scroll in Y
const contentHeight = parentWindow.contentHeight + parentWindow.contentArea[4][1];
if (parentWindow.contentArea[5][1] <= (contentHeight - parentWindow.contentArea[4][3])) {
parentWindow.contentArea[5][1] = ((contentHeight - parentWindow.contentArea[4][3]) * scrollPercentage);
if (parentWindow.contentArea[5][1] <= contentHeight - parentWindow.contentArea[4][3]) {
parentWindow.contentArea[5][1] = (contentHeight - parentWindow.contentArea[4][3]) * scrollPercentage;
} else if (parentWindow.contentArea[4][3] < contentHeight) {
parentWindow.contentArea[5][1] = contentHeight - parentWindow.contentArea[4][3];
} else {
Expand Down Expand Up @@ -1324,8 +1324,8 @@ function canTop (canvasItem, designName, useBackground, width, height, gridX, gr

// Maximum positive scroll in X and scolling
const contentWidth = parentWindow.contentWidth + parentWindow.contentArea[4][0];
if (parentWindow.contentArea[5][0] <= (contentWidth - parentWindow.contentArea[4][2])) {
parentWindow.contentArea[5][0] = ((contentWidth - parentWindow.contentArea[4][2]) * scrollPercentage);
if (parentWindow.contentArea[5][0] <= contentWidth - parentWindow.contentArea[4][2]) {
parentWindow.contentArea[5][0] = (contentWidth - parentWindow.contentArea[4][2]) * scrollPercentage;
} else if (parentWindow.contentArea[4][2] < contentWidth) {
parentWindow.contentArea[5][0] = contentWidth - parentWindow.contentArea[4][2];
} else {
Expand Down

0 comments on commit 8994529

Please sign in to comment.