Handle SVG attributes in correct sequence.

Closes #694.
This commit is contained in:
Jürg Lehni 2015-06-16 15:54:29 +02:00
parent 7a6ee5d5f4
commit ecfa09e676
2 changed files with 6 additions and 4 deletions

View file

@ -674,8 +674,7 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
this._updateVersion++;
ctx.save();
matrix.applyToContext(ctx);
// Use new Base() so we can use param.extend() to easily override
// values
// Use new Base() so we can use param.extend() to easily override values
var param = new Base({
offset: new Point(0, 0),
pixelRatio: pixelRatio,

View file

@ -374,7 +374,10 @@ new function() {
// We need to define style attributes first, and merge in all others after,
// since transform needs to be applied after fill color, as transformations
// can affect gradient fills.
var attributes = Base.each(SVGStyles, function(entry) {
// Use Base.set() to control sequence of attributes and have all entries in
// SVGStyles (e.g. 'stroke') before the additional attributes below (e.g.
// 'stroke-opacity'). See issue #694.
var attributes = Base.set(Base.each(SVGStyles, function(entry) {
this[entry.attribute] = function(item, value) {
item[entry.set](convertValue(value, entry.type, entry.fromSVG));
// When applying gradient colors to shapes, we need to offset
@ -388,7 +391,7 @@ new function() {
item.getPosition(true).negate()));
}
};
}, {
}, {}), {
id: function(item, value) {
definitions[value] = item;
if (item.setName)