text proportional scale

master
Mark MacKay 2021-07-19 10:18:54 -05:00
parent 2f8c3f1af9
commit f602848cba
3 changed files with 9 additions and 3 deletions

View File

@ -392,7 +392,7 @@
<h4>Text</h4> <h4>Text</h4>
<div class="draginputs"> <div class="draginputs">
<label class="draginput twocol textcontent hidden" data-title="Change Content"> <label class="draginput twocol textcontent hidden" data-title="Change Content">
<input id="text" type="text"/> <input id="text" type="text" autocomplete="off"/>
<span>Content</span> <span>Content</span>
</label> </label>
<label> <label>

View File

@ -112,7 +112,7 @@ svgedit.select.Selector.prototype.updateGripCursors = function(angle) {
} }
var i = 0; var i = 0;
for (var dir in selectorManager_.selectorGrips) { for (var dir in selectorManager_.selectorGrips) {
selectorManager_.selectorGrips[dir].setAttribute('style', ('cursor:' + dir_arr[i] + '-resize')); selectorManager_.selectorGrips[dir].style.cursor = dir_arr[i] + '-resize';
i++; i++;
}; };
}; };
@ -128,6 +128,11 @@ svgedit.select.Selector.prototype.showGrips = function(show) {
var elem = this.selectedElement; var elem = this.selectedElement;
this.hasGrips = show; this.hasGrips = show;
if(elem && show) { if(elem && show) {
const isText = elem.tagName === "text";
const grips = selectorManager_.selectorGrips;
["n", "s", "e", "w"].forEach(dir => {
grips[dir].style.display = isText ? "none" : "inline";
});
this.selectorGroup.appendChild(selectorManager_.selectorGripsGroup); this.selectorGroup.appendChild(selectorManager_.selectorGripsGroup);
this.updateGripCursors(svgedit.utilities.getRotationAngle(elem)); this.updateGripCursors(svgedit.utilities.getRotationAngle(elem));
} }

View File

@ -1317,6 +1317,7 @@ var recalculateDimensions = this.recalculateDimensions = function(selected) {
tlist.removeItem(k-2); tlist.removeItem(k-2);
tlist.appendItem(mt); tlist.appendItem(mt);
} }
} }
// If it still has a single [M] or [R][M], return null too (prevents BatchCommand from being returned). // If it still has a single [M] or [R][M], return null too (prevents BatchCommand from being returned).
@ -2746,7 +2747,7 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
translateOrigin.setTranslate(-(left+tx),-(top+ty)); translateOrigin.setTranslate(-(left+tx),-(top+ty));
} }
if(evt.shiftKey) { if(evt.shiftKey || selected.tagName === "text") {
if(sx == 1) sx = sy if(sx == 1) sx = sy
else sy = sx; else sy = sx;
} }