diff --git a/history.txt b/history.txt
index cc8e1b41..51d2c3df 100755
--- a/history.txt
+++ b/history.txt
@@ -4170,6 +4170,10 @@ in development:
------
* Threads: added capability to JIT-compile command scripts to JS
+180620
+------
+* Sketch: enable right-click to select secondary color in vector paint editor
+
=== v4.2 major release (draft) ===
diff --git a/sketch.js b/sketch.js
index 56628bc0..b8794953 100644
--- a/sketch.js
+++ b/sketch.js
@@ -50,6 +50,8 @@
2018, June 5 (Jens):
- fixed initial rotation center for an existing costume
- fixed initial rendering, so costumes can be re-opened after saving
+ 2018, June 20 (Jens):
+ - select primary color with right-click (in addition to shift-click)
*/
/*global Point, Object, Rectangle, AlignmentMorph, Morph, XML_Element, nop,
@@ -57,7 +59,7 @@ PaintColorPickerMorph, Color, SliderMorph, InputFieldMorph, ToggleMorph,
TextMorph, Image, newCanvas, PaintEditorMorph, StageMorph, Costume, isNil,
localize, PaintCanvasMorph, detect, modules*/
-modules.sketch = '2018-June-05';
+modules.sketch = '2018-June-20';
// Declarations
@@ -1275,6 +1277,16 @@ VectorPaintEditorMorph.prototype.populatePropertiesMenu = function () {
}
);
+ // allow right-click on the color picker to select the secondary color
+ pc.colorpicker.mouseDownRight = function (pos) {
+ if ((pos.subtract(this.position()).x > this.width() * 2 / 3) &&
+ (pos.subtract(this.position()).y > this.height() - 10)) {
+ this.action("transparent", true);
+ } else {
+ this.action(this.getPixelColor(pos), true);
+ }
+ };
+
pc.colorpicker.action(new Color(0, 0, 0));
pc.colorpicker.action('transparent', true); // secondary color
diff --git a/snap.html b/snap.html
index c6e26721..e22ecc8f 100755
--- a/snap.html
+++ b/snap.html
@@ -15,7 +15,7 @@
-
+