kopia lustrzana https://github.com/backface/turtlestitch
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.pull/89/head
rodzic
0565310e52
commit
3885ef0cde
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue