Skip to content

Commit 3128ff6

Browse files
committed
Merge pull request AdamAtomic#189 from Dovyski/fix-camera-offset-by-one
Fix offset by one in STYLE_LOCKON camera mode.
2 parents fc64079 + 32bc4cd commit 3128ff6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/org/flixel/FlxCamera.as

+2-2
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ package org.flixel
304304

305305
if ((target is FlxSprite) && (FlxSprite(target).isSimpleRender()))
306306
{
307-
targetX = FlxU.ceil(targetX);
308-
targetY = FlxU.ceil(targetY);
307+
targetX = FlxU.floor(targetX);
308+
targetY = FlxU.floor(targetY);
309309
}
310310

311311
edge = targetX - deadzone.x;

src/org/flixel/FlxSprite.as

+2-2
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,8 @@ package org.flixel
461461
camera = cameras[i++];
462462
if(!onScreen(camera))
463463
continue;
464-
_point.x = x - int(camera.scroll.x*scrollFactor.x) - FlxU.floor(offset.x);
465-
_point.y = y - int(camera.scroll.y*scrollFactor.y) - FlxU.floor(offset.y);
464+
_point.x = x - int(camera.scroll.x*scrollFactor.x) - offset.x;
465+
_point.y = y - int(camera.scroll.y*scrollFactor.y) - offset.y;
466466
_point.x += (_point.x > 0)?0.0000001:-0.0000001;
467467
_point.y += (_point.y > 0)?0.0000001:-0.0000001;
468468

0 commit comments

Comments
 (0)