textPath with transform
parent
f602848cba
commit
56b57cd0ec
|
@ -128,11 +128,12 @@ svgedit.select.Selector.prototype.showGrips = function(show) {
|
|||
var elem = this.selectedElement;
|
||||
this.hasGrips = 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";
|
||||
});
|
||||
// hide unproportional scale grips
|
||||
// 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.updateGripCursors(svgedit.utilities.getRotationAngle(elem));
|
||||
}
|
||||
|
|
|
@ -971,7 +971,6 @@ var remapElement = this.remapElement = function(selected,changes,m) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
var elName = selected.tagName;
|
||||
if(elName === "g" || elName === "text" || elName === "use") {
|
||||
// if it was a translate, then just update x,y
|
||||
|
@ -2747,7 +2746,7 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
|
|||
translateOrigin.setTranslate(-(left+tx),-(top+ty));
|
||||
}
|
||||
|
||||
if(evt.shiftKey || selected.tagName === "text") {
|
||||
if(evt.shiftKey) {
|
||||
if(sx == 1) sx = sy
|
||||
else sy = sx;
|
||||
}
|
||||
|
@ -7523,6 +7522,7 @@ this.textPath = function(){
|
|||
const textPath = svgdoc.createElementNS(svgns, "textPath");
|
||||
textPath.textContent = text.textContent;
|
||||
text.textContent = "";
|
||||
text.removeAttribute("transform");
|
||||
text.setAttribute("text-anchor", "middle");
|
||||
text.setAttribute("x", 0);
|
||||
text.setAttribute("y", 0);
|
||||
|
|
Loading…
Reference in New Issue