deselect when drawing path

master
Mark MacKay 2021-10-09 14:53:35 -05:00
parent 65ad8aa92e
commit 9b6866991b
3 changed files with 47 additions and 35 deletions

View File

@ -38,3 +38,7 @@
#panels.multiselected #multiselected_panel .hidable {
display: none;
}
#tool_place_text_on_path {
display: none;
}

View File

@ -101,8 +101,9 @@ MD.Text = function(){
.keyup(function(e){
e.stopPropagation();
if (e.key === "Escape" || e.key === "Enter") {
if (!$("#text_panel").hasClass("text-path")) svgCanvas.textActions.toSelectMode();
svgCanvas.textActions.toSelectMode();
this.blur();
editor.saveCanvas();
return editor.escapeMode();
}
svgCanvas.setTextContent(this.value);

View File

@ -3484,10 +3484,12 @@ var textActions = canvas.textActions = function() {
if(!blinker) {
blinker = setInterval(function() {
var show = (cursor.getAttribute('display') === 'none');
cursor.setAttribute('display', show?'inline':'none');
cursor.setAttribute('display', show ? 'inline': 'none');
}, 600);
}
console.log("blinker", blinker)
var start_pt = ptToScreen(charbb.x, textbb.y);
var end_pt = ptToScreen(charbb.x, (textbb.y + textbb.height));
@ -3820,7 +3822,7 @@ var pathActions = canvas.pathActions = function() {
p.setAttribute("d", pathActions.convertPath(p));
}
// TODO: Move into path.js
// TODO: Move into path.js
svgedit.path.Path.prototype.endChanges = function(text) {
if(svgedit.browser.isWebkit()) resetD(this.elem);
var cmd = new ChangeElementCommand(this.elem, {d: this.last_d}, text);
@ -3936,6 +3938,11 @@ var pathActions = canvas.pathActions = function() {
return {
mouseDown: function(evt, mouse_target, start_x, start_y) {
if(current_mode === "path") {
// deselect when start draw
svgCanvas.removeFromSelection(svgCanvas.getSelectedElems())
mouse_x = start_x;
mouse_y = start_y;