Merge pull request #214 from nathan/dont-round-costume-center

Fixed rounding costume center coordinates in vector mode
This commit is contained in:
Nathan Dinsmore 2014-06-24 14:18:38 -04:00
commit 89f28a2e22
2 changed files with 3 additions and 3 deletions

View file

@ -345,7 +345,7 @@ public class BitmapEdit extends ImageEdit {
public override function translateContents(x:Number, y:Number):void { public override function translateContents(x:Number, y:Number):void {
var bm:BitmapData = workArea.getBitmap().bitmapData; var bm:BitmapData = workArea.getBitmap().bitmapData;
var newBM:BitmapData = new BitmapData(bm.width, bm.height, true, 0); 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; workArea.getBitmap().bitmapData = newBM;
} }

View file

@ -96,8 +96,8 @@ package svgeditor.tools
private function mouseUp(e:MouseEvent):void { private function mouseUp(e:MouseEvent):void {
var canvas:ImageCanvas = editor.getWorkArea(); var canvas:ImageCanvas = editor.getWorkArea();
var ox:int = Math.round(ImageCanvas.canvasWidth / 2 - canvas.getVisibleLayer().mouseX); var ox:Number = ImageCanvas.canvasWidth / 2 - canvas.getVisibleLayer().mouseX;
var oy:int = Math.round(ImageCanvas.canvasHeight / 2 - canvas.getVisibleLayer().mouseY); var oy:Number = ImageCanvas.canvasHeight / 2 - canvas.getVisibleLayer().mouseY;
editor.translateContents(ox, oy); editor.translateContents(ox, oy);
editor.endCurrentTool(); editor.endCurrentTool();
} }