Skip to content

Commit b5d3d5a

Browse files
committed
Camera bounds fix
1 parent b63620b commit b5d3d5a

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

v3/src/camera/Camera.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,17 @@ Camera.prototype = {
235235
{
236236
this.scrollX = bounds.x;
237237
}
238-
else if (this.scrollX > bounds.right)
238+
else if (this.scrollX > bounds.right - width)
239239
{
240-
this.scrollX = bounds.right;
240+
this.scrollX = bounds.right - width;
241241
}
242-
243242
if (this.scrollY < bounds.y)
244243
{
245244
this.scrollY = bounds.y;
246245
}
247-
else if (this.scrollY > bounds.bottom)
246+
else if (this.scrollY > bounds.bottom - height)
248247
{
249-
this.scrollY = bounds.bottom;
248+
this.scrollY = bounds.bottom - height;
250249
}
251250
}
252251

0 commit comments

Comments
 (0)