Skip to content

Commit

Permalink
TINY-1514: fixed scroll calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
spocke committed Feb 23, 2018
1 parent 3b38292 commit 10534f7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ui/main/ts/Movable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ export default {
return rels[i];
}
} else {
if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w + viewPortRect.x &&
pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h + viewPortRect.y) {
if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w && pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h) {
return rels[i];
}
}
Expand Down Expand Up @@ -206,8 +205,8 @@ export default {
const viewPortRect = getViewPortRect(this);
const layoutRect = self.layoutRect();

x = constrain(x, viewPortRect.w + viewPortRect.x, layoutRect.w);
y = constrain(y, viewPortRect.h + viewPortRect.y, layoutRect.h);
x = constrain(x, viewPortRect.w, layoutRect.w);
y = constrain(y, viewPortRect.h, layoutRect.h);
}

const uiContainer = UiContainer.getUiContainer(self);
Expand Down

0 comments on commit 10534f7

Please sign in to comment.