diff --git a/history.txt b/history.txt index a6b32764..72a34a65 100755 --- a/history.txt +++ b/history.txt @@ -2146,5 +2146,6 @@ ______ * BYOB: new scriptsPicture() method for custom block definitions * GUI: new (hidden) feature: “Export all scripts as pic” (including custom block refs) * Graphic effects!!! Yay, thanks, Yuan! -* Bug fixes from Nathan, yay, thank, Nathan!! +* Bug fixes from Nathan, yay, thanks, Nathan!! * German translation update +* Paint Editor transforms, yay, thanks, Kartik!! diff --git a/paint.js b/paint.js index d4d29545..7105b723 100644 --- a/paint.js +++ b/paint.js @@ -54,6 +54,7 @@ Feb 11 - dynamically adjust to stage dimensions (Jens) Apr 30 - localizations (Manuel) June 3 - transformations (Kartik) + June 4 - tweaks (Jens) */ @@ -67,7 +68,7 @@ // Global stuff //////////////////////////////////////////////////////// -modules.paint = '2014-June-3'; +modules.paint = '2014-June-4'; // Declarations @@ -112,10 +113,10 @@ PaintEditorMorph.prototype.buildContents = function () { this.paper.setExtent(StageMorph.prototype.dimensions); this.addBody(new AlignmentMorph('row', this.padding)); - this.controls = new AlignmentMorph('column', this.padding); + this.controls = new AlignmentMorph('column', this.padding / 2); this.controls.alignment = 'left'; - this.edits = new AlignmentMorph('row', this.padding); + this.edits = new AlignmentMorph('row', this.padding / 2); this.buildEdits(); this.controls.add(this.edits); @@ -134,7 +135,7 @@ PaintEditorMorph.prototype.buildContents = function () { this.buildToolbox(); this.controls.add(this.toolbox); - this.scaleBox = new AlignmentMorph('row', this.padding); + this.scaleBox = new AlignmentMorph('row', this.padding / 2); this.buildScaleBox(); this.controls.add(this.scaleBox); @@ -584,13 +585,20 @@ PaintCanvasMorph.prototype.init = function (shift) { this.buildContents(); }; -PaintCanvasMorph.prototype.scale = function(x, y) { +PaintCanvasMorph.prototype.scale = function (x, y) { this.mask = newCanvas(this.extent()); var c = newCanvas(this.extent()); c.getContext("2d").save(); - c.getContext("2d").translate(this.rotationCenter.x, this.rotationCenter.y); + c.getContext("2d").translate( + this.rotationCenter.x, + this.rotationCenter.y + ); c.getContext("2d").scale(1 + x, 1 + y); - c.getContext("2d").drawImage(this.paper, -this.rotationCenter.x, -this.rotationCenter.y); + c.getContext("2d").drawImage( + this.paper, + -this.rotationCenter.x, + -this.rotationCenter.y + ); c.getContext("2d").restore(); this.paper = c; this.drawNew();