From 6f074e4799d73c91ebe0429c79bb2a690ca71dd9 Mon Sep 17 00:00:00 2001 From: Manuel Menezes de Sequeira Date: Sun, 9 Mar 2014 21:57:07 +0000 Subject: Add localization support for 'Brush size' string. --- paint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'paint.js') diff --git a/paint.js b/paint.js index 1929f95..7f1504d 100644 --- a/paint.js +++ b/paint.js @@ -371,7 +371,7 @@ PaintEditorMorph.prototype.populatePropertiesMenu = function () { c.add(pc.colorpicker); //c.add(pc.primaryColorButton); c.add(pc.primaryColorViewer); - c.add(new TextMorph("Brush size")); + c.add(new TextMorph(localize("Brush size"))); c.add(alpen); c.add(pc.constrain); }; -- cgit v1.3.1 From ebb4b9301055ba94f53328f18a2c26657c66972f Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 30 Apr 2014 12:30:19 +0200 Subject: integrate localisation changes --- byob.js | 7 +++++-- paint.js | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'paint.js') diff --git a/byob.js b/byob.js index 5946fd5..9e0c067 100644 --- a/byob.js +++ b/byob.js @@ -106,7 +106,7 @@ SymbolMorph, isNil*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2014-January-10'; +modules.byob = '2014-April-30'; // Declarations @@ -2579,7 +2579,10 @@ InputSlotDialogMorph.prototype.symbolMenu = function () { myself = this; SymbolMorph.prototype.names.forEach(function (symbol) { symbols.push([ - [new SymbolMorph(symbol, myself.fontSize, symbolColor), localize(symbol)], + [ + new SymbolMorph(symbol, myself.fontSize, symbolColor), + localize(symbol) + ], '$' + symbol ]); }); diff --git a/paint.js b/paint.js index fd53122..44c988b 100644 --- a/paint.js +++ b/paint.js @@ -52,6 +52,7 @@ September 16 - flood fill freeze fix (Kartik) Jan 08 - mouse leave dragging fix (Kartik) Feb 11 - dynamically adjust to stage dimensions (Jens) + Apr 30 - localizations (Manuel) */ @@ -65,7 +66,7 @@ // Global stuff //////////////////////////////////////////////////////// -modules.paint = '2014-February-11'; +modules.paint = '2014-April-30'; // Declarations -- cgit v1.3.1 From f9989ad7cfa5e27b4784d8cd464fdc7cbe289942 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Fri, 2 May 2014 11:08:30 +0200 Subject: checkpoint - release --- blocks.js | 2 +- lang-ru.js | 3 ++- locale.js | 2 +- paint.js | 2 +- store.js | 2 +- threads.js | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) (limited to 'paint.js') diff --git a/blocks.js b/blocks.js index 8e868f8..69ae610 100644 --- a/blocks.js +++ b/blocks.js @@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph, Costume*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2014-April-30'; +modules.blocks = '2014-May-02'; var SyntaxElementMorph; diff --git a/lang-ru.js b/lang-ru.js index 4834f7c..f113f2c 100644 --- a/lang-ru.js +++ b/lang-ru.js @@ -168,7 +168,8 @@ SnapTranslator.dict.ru = { Special characters: (see ) €, Š \u00c4, \u00e4 -…, š \u00d6, \u00f6 + +, š \u00d6, \u00f6 †, Ÿ \u00dc, \u00fc § \u00df */ diff --git a/locale.js b/locale.js index c6924e9..d981960 100644 --- a/locale.js +++ b/locale.js @@ -42,7 +42,7 @@ /*global modules, contains*/ -modules.locale = '2014-April-30'; +modules.locale = '2014-May-02'; // Global stuff diff --git a/paint.js b/paint.js index 44c988b..ee40b23 100644 --- a/paint.js +++ b/paint.js @@ -66,7 +66,7 @@ // Global stuff //////////////////////////////////////////////////////// -modules.paint = '2014-April-30'; +modules.paint = '2014-May-02'; // Declarations diff --git a/store.js b/store.js index d69667a..e143245 100644 --- a/store.js +++ b/store.js @@ -61,7 +61,7 @@ SyntaxElementMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2014-April-30'; +modules.store = '2014-May-02'; // XML_Serializer /////////////////////////////////////////////////////// diff --git a/threads.js b/threads.js index 2d954a8..b82a8c5 100644 --- a/threads.js +++ b/threads.js @@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2014-April-30'; +modules.threads = '2014-May-02'; var ThreadManager; var Process; -- cgit v1.3.1 From 6d9ce7b61c61ff737133dd3490c6caf854793f04 Mon Sep 17 00:00:00 2001 From: Hardmath123 Date: Tue, 3 Jun 2014 15:28:07 -0700 Subject: Added scaling and flipping --- paint.js | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) (limited to 'paint.js') diff --git a/paint.js b/paint.js index ee40b23..12f4f82 100644 --- a/paint.js +++ b/paint.js @@ -3,12 +3,12 @@ a paint editor for Snap! inspired by the Scratch paint editor. - + written by Kartik Chandra Copyright (C) 2014 by Kartik Chandra - + This file is part of Snap!. - + Snap! is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of @@ -133,6 +133,10 @@ PaintEditorMorph.prototype.buildContents = function () { this.buildToolbox(); this.controls.add(this.toolbox); + this.scaleBox = new AlignmentMorph('row', this.padding); + this.buildScaleBox(); + this.controls.add(this.scaleBox); + this.propertiesControls = { colorpicker: null, penSizeSlider: null, @@ -218,6 +222,27 @@ PaintEditorMorph.prototype.buildEdits = function () { this.edits.fixLayout(); }; +PaintEditorMorph.prototype.buildScaleBox = function () { + var paper = this.paper; + this.scaleBox.add(this.pushButton( + "grow", + function () {paper.scale(0.05, 0.05); } + )); + this.scaleBox.add(this.pushButton( + "shrink", + function () {paper.scale(-0.05, -0.05); } + )); + this.scaleBox.add(this.pushButton( + "flipX", + function () {paper.scale(-2, 0); } + )); + this.scaleBox.add(this.pushButton( + "flipY", + function () {paper.scale(0, -2); } + )); + this.scaleBox.fixLayout(); +}; + PaintEditorMorph.prototype.openIn = function (world, oldim, oldrc, callback) { // Open the editor in a world with an optional image to edit this.oldim = oldim; @@ -558,6 +583,19 @@ PaintCanvasMorph.prototype.init = function (shift) { this.buildContents(); }; +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").scale(1 + x, 1 + y); + c.getContext("2d").drawImage(this.paper, -this.rotationCenter.x, -this.rotationCenter.y); + c.getContext("2d").restore(); + this.paper = c; + this.drawNew(); + this.changed(); +}; + PaintCanvasMorph.prototype.cacheUndo = function () { var cachecan = newCanvas(this.extent()); this.merge(this.paper, cachecan); -- cgit v1.3.1 From f5fca5418765f1783e056de82072351d144adb50 Mon Sep 17 00:00:00 2001 From: Hardmath123 Date: Tue, 3 Jun 2014 15:32:41 -0700 Subject: Docs, symbols --- paint.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'paint.js') diff --git a/paint.js b/paint.js index 12f4f82..d4d2954 100644 --- a/paint.js +++ b/paint.js @@ -53,6 +53,7 @@ Jan 08 - mouse leave dragging fix (Kartik) Feb 11 - dynamically adjust to stage dimensions (Jens) Apr 30 - localizations (Manuel) + June 3 - transformations (Kartik) */ @@ -66,7 +67,7 @@ // Global stuff //////////////////////////////////////////////////////// -modules.paint = '2014-May-02'; +modules.paint = '2014-June-3'; // Declarations @@ -233,11 +234,11 @@ PaintEditorMorph.prototype.buildScaleBox = function () { function () {paper.scale(-0.05, -0.05); } )); this.scaleBox.add(this.pushButton( - "flipX", + "flip ↔", function () {paper.scale(-2, 0); } )); this.scaleBox.add(this.pushButton( - "flipY", + "flip ↕", function () {paper.scale(0, -2); } )); this.scaleBox.fixLayout(); -- cgit v1.3.1 From ef140b093ebb61d37235ce7f4baf5fd4c0baf01d Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 4 Jun 2014 14:16:57 +0200 Subject: Paint Editor transform integration - little tweaks Thanks, Kartik!! --- history.txt | 3 ++- paint.js | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'paint.js') diff --git a/history.txt b/history.txt index a6b3276..72a34a6 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 d4d2954..7105b72 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(); -- cgit v1.3.1