mirror of
https://github.com/scratchfoundation/scratch-flash.git
synced 2024-12-04 13:11:12 -05:00
Merge pull request #214 from nathan/dont-round-costume-center
Fixed rounding costume center coordinates in vector mode
This commit is contained in:
commit
89f28a2e22
2 changed files with 3 additions and 3 deletions
|
@ -345,7 +345,7 @@ public class BitmapEdit extends ImageEdit {
|
|||
public override function translateContents(x:Number, y:Number):void {
|
||||
var bm:BitmapData = workArea.getBitmap().bitmapData;
|
||||
var newBM:BitmapData = new BitmapData(bm.width, bm.height, true, 0);
|
||||
newBM.copyPixels(bm, bm.rect, new Point(2 * x, 2 * y));
|
||||
newBM.copyPixels(bm, bm.rect, new Point(Math.round(2 * x), Math.round(2 * y)));
|
||||
workArea.getBitmap().bitmapData = newBM;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,8 +96,8 @@ package svgeditor.tools
|
|||
|
||||
private function mouseUp(e:MouseEvent):void {
|
||||
var canvas:ImageCanvas = editor.getWorkArea();
|
||||
var ox:int = Math.round(ImageCanvas.canvasWidth / 2 - canvas.getVisibleLayer().mouseX);
|
||||
var oy:int = Math.round(ImageCanvas.canvasHeight / 2 - canvas.getVisibleLayer().mouseY);
|
||||
var ox:Number = ImageCanvas.canvasWidth / 2 - canvas.getVisibleLayer().mouseX;
|
||||
var oy:Number = ImageCanvas.canvasHeight / 2 - canvas.getVisibleLayer().mouseY;
|
||||
editor.translateContents(ox, oy);
|
||||
editor.endCurrentTool();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue