mirror of
https://github.com/photonstorm/phaser
synced 2024-11-28 15:41:37 +00:00
Don't round the midPoint, or it breaks high zoom scrolling. Fix #6878
This commit is contained in:
parent
5aaa5ec601
commit
6acd415d16
1 changed files with 10 additions and 5 deletions
|
@ -555,8 +555,8 @@ var Camera = new Class({
|
||||||
|
|
||||||
if (this.roundPixels)
|
if (this.roundPixels)
|
||||||
{
|
{
|
||||||
sx = Math.floor(sx + 0.5);
|
sx = Math.floor(sx);
|
||||||
sy = Math.floor(sy + 0.5);
|
sy = Math.floor(sy);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.useBounds)
|
if (this.useBounds)
|
||||||
|
@ -569,8 +569,9 @@ var Camera = new Class({
|
||||||
this.scrollX = sx;
|
this.scrollX = sx;
|
||||||
this.scrollY = sy;
|
this.scrollY = sy;
|
||||||
|
|
||||||
var midX = Math.floor((sx + halfWidth) + 0.5);
|
// Don't round the midPoint, otherwise it breaks things like smooth zoom
|
||||||
var midY = Math.floor((sy + halfHeight) + 0.5);
|
var midX = sx + halfWidth;
|
||||||
|
var midY = sy + halfHeight;
|
||||||
|
|
||||||
// The center of the camera, in world space, so taking zoom into account
|
// The center of the camera, in world space, so taking zoom into account
|
||||||
// Basically the pixel value of what it's looking at in the middle of the cam
|
// Basically the pixel value of what it's looking at in the middle of the cam
|
||||||
|
@ -584,7 +585,11 @@ var Camera = new Class({
|
||||||
|
|
||||||
this.worldView.setTo(vwx, vwy, displayWidth, displayHeight);
|
this.worldView.setTo(vwx, vwy, displayWidth, displayHeight);
|
||||||
|
|
||||||
matrix.applyITRS(Math.floor(this.x + originX + 0.5), Math.floor(this.y + originY + 0.5), this.rotation, zoomX, zoomY);
|
matrix.applyITRS(
|
||||||
|
Math.floor(this.x + originX + 0.5),
|
||||||
|
Math.floor(this.y + originY + 0.5),
|
||||||
|
this.rotation,
|
||||||
|
zoomX, zoomY);
|
||||||
|
|
||||||
matrix.translate(-originX, -originY);
|
matrix.translate(-originX, -originY);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue