correct blur on copied and pasted elements, correct dasharray attribute, fixed error with strokes
parent
1e029fa536
commit
77708c595c
|
@ -78,7 +78,7 @@ MD.PaintBox = function(container, type){
|
|||
const elem = selectedElems[0];
|
||||
// fill or stroke
|
||||
var url = elem.getAttribute(type);
|
||||
if (url.includes("(")) {
|
||||
if (url && url.includes("(")) {
|
||||
url = url.split("(")[1].split(")")[0];
|
||||
}
|
||||
// not a gradient
|
||||
|
|
|
@ -182,6 +182,17 @@ MD.Panel = function(){
|
|||
|
||||
if (elem !== null) {
|
||||
$("#stroke_panel").show();
|
||||
$('#stroke_width').val(elem.getAttribute("stroke-width") || 0);
|
||||
// stroke style
|
||||
const strokeStyle = elem.getAttribute("stroke-dasharray") || "none";
|
||||
const strokeStyles = {
|
||||
"none": "—",
|
||||
"2,2": "...",
|
||||
"5,5": "- -",
|
||||
"5,2,2,2": "-·-",
|
||||
"5,2,2,2,2,2": "-··-"
|
||||
};
|
||||
$("#stroke_style_label").html(strokeStyles[strokeStyle] || "—");
|
||||
var elname = elem.nodeName;
|
||||
var angle = svgCanvas.getRotationAngle(elem);
|
||||
$('#angle').val(Math.round(angle));
|
||||
|
|
|
@ -7213,15 +7213,13 @@ this.setPaintOpacity = function(type, val, preventUndo) {
|
|||
// elem - The element to check the blur value for
|
||||
this.getBlur = function(elem) {
|
||||
var val = 0;
|
||||
// var elem = selectedElements[0];
|
||||
|
||||
if(elem) {
|
||||
var filter_url = elem.getAttribute('filter');
|
||||
if(filter_url) {
|
||||
var blur = getElem(elem.id + '_blur');
|
||||
if(blur) {
|
||||
val = blur.firstChild.getAttribute('stdDeviation');
|
||||
}
|
||||
const selector = filter_url.split("url(#")[1].slice(0, -1);
|
||||
var blur = getElem(selector);
|
||||
if (blur) val = blur.firstChild.getAttribute('stdDeviation');
|
||||
}
|
||||
}
|
||||
return val;
|
||||
|
|
Loading…
Reference in New Issue