kopia lustrzana https://github.com/backface/turtlestitch
right-click selects secondary color in vector paint editor
rodzic
e0c30c14f2
commit
761418c3fd
|
@ -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) ===
|
||||
|
||||
|
|
14
sketch.js
14
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
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<script type="text/javascript" src="byob.js?version=2018-06-14"></script>
|
||||
<script type="text/javascript" src="tables.js?version=2018-06-14"></script>
|
||||
<script type="text/javascript" src="symbols.js?version=2018-06-14"></script>
|
||||
<script type="text/javascript" src="sketch.js?version=2018-06-14"></script>
|
||||
<script type="text/javascript" src="sketch.js?version=2018-06-20"></script>
|
||||
<script type="text/javascript" src="xml.js?version=2018-06-14"></script>
|
||||
<script type="text/javascript" src="store.js?version=2018-06-14"></script>
|
||||
<script type="text/javascript" src="locale.js?version=2018-06-14"></script>
|
||||
|
|
Ładowanie…
Reference in New Issue