Skip to content

Commit

Permalink
Fixed cage rendering (with scroll).
Browse files Browse the repository at this point in the history
  • Loading branch information
dariuszdawidowski committed Aug 30, 2024
1 parent d389136 commit e976e90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions editor/cage.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@ class MetavizCage {
if (this.node) {
const container = metaviz.container.getOffset();
const leftTop = metaviz.render.world2Screen({
x: this.node.transform.x - this.node.transform.ox - this.margin + container.x - this.node.transform.border,
y: this.node.transform.y - this.node.transform.oy - this.margin + container.y - this.node.transform.border
x: this.node.transform.x - this.node.transform.ox - this.margin + container.x - this.node.transform.border + window.scrollX,
y: this.node.transform.y - this.node.transform.oy - this.margin + container.y - this.node.transform.border + window.scrollY
});
const rightBottom = metaviz.render.world2Screen({
x: this.node.transform.x - this.node.transform.ox + this.node.transform.w + this.margin + container.left + this.node.transform.border,
y: this.node.transform.y - this.node.transform.oy + this.node.transform.h + this.margin + container.top + this.node.transform.border
x: this.node.transform.x - this.node.transform.ox + this.node.transform.w + this.margin + container.left + this.node.transform.border + window.scrollX,
y: this.node.transform.y - this.node.transform.oy + this.node.transform.h + this.margin + container.top + this.node.transform.border + window.scrollY
});
const width = rightBottom.x - leftTop.x;
const height = rightBottom.y - leftTop.y;
Expand Down

0 comments on commit e976e90

Please sign in to comment.