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];
|
const elem = selectedElems[0];
|
||||||
// fill or stroke
|
// fill or stroke
|
||||||
var url = elem.getAttribute(type);
|
var url = elem.getAttribute(type);
|
||||||
if (url.includes("(")) {
|
if (url && url.includes("(")) {
|
||||||
url = url.split("(")[1].split(")")[0];
|
url = url.split("(")[1].split(")")[0];
|
||||||
}
|
}
|
||||||
// not a gradient
|
// not a gradient
|
||||||
|
|
|
@ -182,6 +182,17 @@ MD.Panel = function(){
|
||||||
|
|
||||||
if (elem !== null) {
|
if (elem !== null) {
|
||||||
$("#stroke_panel").show();
|
$("#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 elname = elem.nodeName;
|
||||||
var angle = svgCanvas.getRotationAngle(elem);
|
var angle = svgCanvas.getRotationAngle(elem);
|
||||||
$('#angle').val(Math.round(angle));
|
$('#angle').val(Math.round(angle));
|
||||||
|
|
|
@ -7213,15 +7213,13 @@ this.setPaintOpacity = function(type, val, preventUndo) {
|
||||||
// elem - The element to check the blur value for
|
// elem - The element to check the blur value for
|
||||||
this.getBlur = function(elem) {
|
this.getBlur = function(elem) {
|
||||||
var val = 0;
|
var val = 0;
|
||||||
// var elem = selectedElements[0];
|
|
||||||
|
|
||||||
if(elem) {
|
if(elem) {
|
||||||
var filter_url = elem.getAttribute('filter');
|
var filter_url = elem.getAttribute('filter');
|
||||||
if(filter_url) {
|
if(filter_url) {
|
||||||
var blur = getElem(elem.id + '_blur');
|
const selector = filter_url.split("url(#")[1].slice(0, -1);
|
||||||
if(blur) {
|
var blur = getElem(selector);
|
||||||
val = blur.firstChild.getAttribute('stdDeviation');
|
if (blur) val = blur.firstChild.getAttribute('stdDeviation');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
|
|
Loading…
Reference in New Issue