From 3885ef0cdeb08576145510f7f316ebe396c6f268 Mon Sep 17 00:00:00 2001 From: brianharvey Date: Fri, 15 Feb 2019 14:34:46 -0800 Subject: [PATCH] fix vector editor colors Reverse edge and fill, rename to edge and fill, fix left-button/right-button selection, all good things, no bad things. --- src/sketch.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/sketch.js b/src/sketch.js index b8794953..cdf1ccf9 100644 --- a/src/sketch.js +++ b/src/sketch.js @@ -1273,11 +1273,11 @@ VectorPaintEditorMorph.prototype.populatePropertiesMenu = function () { pc.colorpicker = new PaintColorPickerMorph( new Point(180, 100), function (color, isSecondary) { - myself.selectColor(color, isSecondary); + myself.selectColor(color, !isSecondary); } ); - // allow right-click on the color picker to select the secondary color + // allow right-click on the color picker to select the fill color pc.colorpicker.mouseDownRight = function (pos) { if ((pos.subtract(this.position()).x > this.width() * 2 / 3) && (pos.subtract(this.position()).y > this.height() - 10)) { @@ -1287,8 +1287,8 @@ VectorPaintEditorMorph.prototype.populatePropertiesMenu = function () { } }; - pc.colorpicker.action(new Color(0, 0, 0)); - pc.colorpicker.action('transparent', true); // secondary color + pc.colorpicker.action(new Color(0, 0, 0)); // secondary color + pc.colorpicker.action('transparent', true); pc.penSizeSlider = new SliderMorph(0, 20, 5, 5); pc.penSizeSlider.orientation = "horizontal"; @@ -1339,12 +1339,12 @@ VectorPaintEditorMorph.prototype.populatePropertiesMenu = function () { function () { return myself.shift; } ); - alignColor.add(pc.primaryColorViewer); alignColor.add(pc.secondaryColorViewer); + alignColor.add(pc.primaryColorViewer); alignColor.fixLayout(); c.add(pc.colorpicker); - c.add(new TextMorph(localize('Primary color Secondary color'))); + c.add(new TextMorph(localize(' Edge color Fill color'))); c.add(alignColor); c.add(new TextMorph(localize('Brush size'))); c.add(alpen); @@ -1647,8 +1647,8 @@ VectorPaintCanvasMorph.prototype.init = function (shift) { this.pointBuffer = []; this.currentTool = 'brush'; this.settings = { - primaryColor: new Color(0, 0, 0, 255), - secondaryColor: new Color(0, 0, 0, 0), + primaryColor: new Color(0, 0, 0, 0), + secondaryColor: new Color(0, 0, 0, 255), lineWidth: 3 }; }; @@ -1862,7 +1862,7 @@ VectorPaintCanvasMorph.prototype.beginShape = function ( case 'brush': this.beginPolygon( // unclosed, freehanded borderWidth, - primaryColor, + secondaryColor, null, pos, false, @@ -1870,7 +1870,7 @@ VectorPaintCanvasMorph.prototype.beginShape = function ( ); break; case 'line': - this.beginLine(borderWidth, primaryColor, pos); + this.beginLine(borderWidth, secondaryColor, pos); break; case 'rectangle': this.beginRectangle(borderWidth, secondaryColor, primaryColor, pos);