Merge pull request #2337 from jmoenig/vector-edit

fix pipette bug
pull/89/head
Jens Mönig 2019-02-22 15:03:24 +01:00 zatwierdzone przez GitHub
commit af4b8141c9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

@ -495,6 +495,7 @@ PaintEditorMorph.prototype.getUserColor = function () {
var myself = this, var myself = this,
world = this.world(), world = this.world(),
hand = world.hand, hand = world.hand,
shifted = this.paper.isShiftPressed();
posInDocument = getDocumentPositionOf(world.worldCanvas), posInDocument = getDocumentPositionOf(world.worldCanvas),
mouseMoveBak = hand.processMouseMove, mouseMoveBak = hand.processMouseMove,
mouseDownBak = hand.processMouseDown, mouseDownBak = hand.processMouseDown,
@ -513,7 +514,7 @@ PaintEditorMorph.prototype.getUserColor = function () {
return; return;
} }
color.a = 255; color.a = 255;
myself.propertiesControls.colorpicker.action(color); myself.propertiesControls.colorpicker.action(color, shifted);
}; };
hand.processMouseDown = nop; hand.processMouseDown = nop;

Wyświetl plik

@ -1223,9 +1223,9 @@ VectorPaintEditorMorph.prototype.buildToolbox = function () {
polygon: polygon:
'Polygon', 'Polygon',
paintbucket: paintbucket:
'Paint a shape\n(shift: secondary color)', 'Paint a shape\n(shift: edge color)',
pipette: pipette:
'Pipette tool\n(pick a color from anywhere\nshift: secondary color)' 'Pipette tool\n(pick a color from anywhere\nshift: fill color)'
}, },
myself = this, myself = this,
left = this.toolbox.left(), left = this.toolbox.left(),
@ -1347,7 +1347,7 @@ VectorPaintEditorMorph.prototype.populatePropertiesMenu = function () {
alignNames.add(new TextMorph(localize('Edge color\n(left click)'), alignNames.add(new TextMorph(localize('Edge color\n(left click)'),
null, null, null, null, null, null, null, null,
'center', 85)); 'center', 85));
alignNames.add(new TextMorph(localize('Fill color\n(rigth click)'), alignNames.add(new TextMorph(localize('Fill color\n(right click)'),
null, null, null, null, null, null, null, null,
'center', 85)); 'center', 85));
alignNames.fixLayout(); alignNames.fixLayout();