mirror of
https://github.com/scratchfoundation/scratch-flash.git
synced 2024-12-04 21:21:06 -05:00
Merge pull request #275 from nathan/infinite-position
Fixed setting x or y position to +-Infinity
This commit is contained in:
commit
2eb84b276d
1 changed files with 2 additions and 2 deletions
|
@ -172,8 +172,8 @@ public class ScratchSprite extends ScratchObj {
|
|||
}
|
||||
|
||||
public function setScratchXY(newX:Number, newY:Number):void {
|
||||
scratchX = newX;
|
||||
scratchY = newY;
|
||||
scratchX = isFinite(newX) ? newX : newX > 0 ? 1e6 : -1e6;
|
||||
scratchY = isFinite(newY) ? newY : newY > 0 ? 1e6 : -1e6;
|
||||
x = 240 + Math.round(scratchX);
|
||||
y = 180 - Math.round(scratchY);
|
||||
updateBubble();
|
||||
|
|
Loading…
Reference in a new issue