reinstate fill and change dashed shortcut
This commit is contained in:
parent
27ea6a8be9
commit
05e6c7b33f
13
draw.js
13
draw.js
|
|
@ -170,13 +170,11 @@ var DrawingArea = new Lang.Class({
|
|||
}
|
||||
|
||||
if (button == 1) {
|
||||
this._startDrawing(x, y, false, shiftPressed);
|
||||
this._startDrawing(x, y, shiftPressed);
|
||||
return Clutter.EVENT_STOP;
|
||||
} else if (button == 2) {
|
||||
this.toggleShape();
|
||||
} else if (button == 3) {
|
||||
/*this._startDrawing(x, y, true, shiftPressed);
|
||||
return Clutter.EVENT_STOP;*/
|
||||
this.menu.open(x, y);
|
||||
return Clutter.EVENT_STOP;
|
||||
}
|
||||
|
|
@ -231,7 +229,7 @@ var DrawingArea = new Lang.Class({
|
|||
return Clutter.EVENT_STOP;
|
||||
},
|
||||
|
||||
_startDrawing: function(stageX, stageY, fill, eraser) {
|
||||
_startDrawing: function(stageX, stageY, eraser) {
|
||||
let [success, startX, startY] = this.transform_stage_point(stageX, stageY);
|
||||
|
||||
if (!success)
|
||||
|
|
@ -248,7 +246,7 @@ var DrawingArea = new Lang.Class({
|
|||
color: this.currentColor.to_string(),
|
||||
line: { lineWidth: this.currentLineWidth, lineJoin: this.currentLineJoin, lineCap: this.currentLineCap },
|
||||
dash: { array: this.dashedLine ? this.dashArray : [0, 0] , offset: this.dashedLine ? this.dashOffset : 0 },
|
||||
fill: fill,
|
||||
fill: this.fill,
|
||||
eraser: eraser,
|
||||
transform: { active: false, center: [0, 0], angle: 0, startAngle: 0, ratio: 1 },
|
||||
text: '',
|
||||
|
|
@ -424,6 +422,11 @@ var DrawingArea = new Lang.Class({
|
|||
this.selectShape((this.currentShape == Object.keys(Shapes).length - 1) ? 0 : this.currentShape + 1);
|
||||
},
|
||||
|
||||
toggleFill: function() {
|
||||
this.fill = !this.fill;
|
||||
this.emitter.emit('show-osd', this.fill ? _("Fill") : _("Stroke"), null);
|
||||
},
|
||||
|
||||
toggleDash: function() {
|
||||
this.dashedLine = !this.dashedLine;
|
||||
this.emitter.emit('show-osd', this.dashedLine ? _("Dashed line") : _("Full line"), null);
|
||||
|
|
|
|||
|
|
@ -150,6 +150,7 @@ var AreaManager = new Lang.Class({
|
|||
'toggle-linejoin': this.activeArea.toggleLineJoin.bind(this.activeArea),
|
||||
'toggle-linecap': this.activeArea.toggleLineCap.bind(this.activeArea),
|
||||
'toggle-dash' : this.activeArea.toggleDash.bind(this.activeArea),
|
||||
'toggle-fill' : this.activeArea.toggleFill.bind(this.activeArea),
|
||||
'select-none-shape': () => this.activeArea.selectShape(Draw.Shapes.NONE),
|
||||
'select-line-shape': () => this.activeArea.selectShape(Draw.Shapes.LINE),
|
||||
'select-ellipse-shape': () => this.activeArea.selectShape(Draw.Shapes.ELLIPSE),
|
||||
|
|
|
|||
|
|
@ -43,6 +43,12 @@ msgstr ""
|
|||
msgid "Text"
|
||||
msgstr ""
|
||||
|
||||
msgid "Fill"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stroke"
|
||||
msgstr ""
|
||||
|
||||
msgid "Dashed line"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -81,9 +87,6 @@ msgstr ""
|
|||
msgid "Smooth"
|
||||
msgstr ""
|
||||
|
||||
msgid "Fill"
|
||||
msgstr ""
|
||||
|
||||
msgid "Dashed"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -148,6 +151,9 @@ msgstr ""
|
|||
msgid "Unselect shape (free drawing)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Select fill/stroke"
|
||||
msgstr ""
|
||||
|
||||
msgid "Change font family (generic name)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
1
prefs.js
1
prefs.js
|
|
@ -56,6 +56,7 @@ var INTERNAL_KEYBINDINGS = {
|
|||
'select-rectangle-shape': "Select rectangle",
|
||||
'select-text-shape': "Select text",
|
||||
'select-none-shape': "Unselect shape (free drawing)",
|
||||
'toggle-fill': "Select fill/stroke",
|
||||
'-separator-3': '',
|
||||
'toggle-font-family': "Change font family (generic name)",
|
||||
'toggle-font-weight': "Change font weight",
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -117,10 +117,15 @@
|
|||
<description>toggle linecap</description>
|
||||
</key>
|
||||
<key type="as" name="toggle-dash">
|
||||
<default>["<Primary>a"]</default>
|
||||
<default>["<Primary>period"]</default>
|
||||
<summary>toggle dash</summary>
|
||||
<description>toggle dash</description>
|
||||
</key>
|
||||
<key type="as" name="toggle-fill">
|
||||
<default>["<Primary>a"]</default>
|
||||
<summary>toggle fill</summary>
|
||||
<description>toggle fill</description>
|
||||
</key>
|
||||
<key type="as" name="select-color1">
|
||||
<default><![CDATA[['<Primary>KP_1','<Primary>1']]]></default>
|
||||
<summary>select color1</summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue