Commit 61396137 authored by Christian Winter's avatar Christian Winter

bugfix. loading files with transparent lines working

parent 7972ded9
Pipeline #5173130 failed with stage
in 48 seconds
......@@ -158,15 +158,19 @@
if (line.nodeName != "line")
continue;
lines.push(new Line(
let newLine = new Line(
Number(line.getAttribute("x1")),
Number(line.getAttribute("y1")),
Number(line.getAttribute("x2")),
Number(line.getAttribute("y2")),
Color.hexToColor(line.getAttribute('stroke')),
Number(line.getAttribute('stroke-width'))
));
);
newLine.color.a = Number(line.getAttribute('stroke-opacity'));
lines.push(newLine);
}
prefab.data.lines = lines;
PrefabManager.addPrefab(prefab);
}
......@@ -239,16 +243,19 @@
layer.data.addInstance(instance);
continue;
}
lines.push(new Line(
// normal line
let newLine = new Line(
Number(line.getAttribute("x1")),
Number(line.getAttribute("y1")),
Number(line.getAttribute("x2")),
Number(line.getAttribute("y2")),
Color.hexToColor(line.getAttribute('stroke')),
Number(line.getAttribute('stroke-width'))
));
);
newLine.color.a = Number(line.getAttribute('stroke-opacity'));
lines.push(newLine);
}
// not using addLine() because due to 'cutLines' it could lead to unwanted results
layer.data.lines = lines;
......@@ -258,4 +265,4 @@
GUI.objectHierarchyChanged();
Application.file.updateStats();
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment