mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
SVG Importer: add support for stroke-opacity and fill-opacity.
This commit is contained in:
parent
41b2047a88
commit
808073fa63
1 changed files with 10 additions and 0 deletions
|
@ -401,6 +401,16 @@ new function() {
|
|||
item.setOpacity(opacity);
|
||||
}
|
||||
break;
|
||||
// http://www.w3.org/TR/SVG/painting.html#FillOpacityProperty
|
||||
case 'fill-opacity':
|
||||
// http://www.w3.org/TR/SVG/painting.html#StrokeOpacityProperty
|
||||
case 'stroke-opacity':
|
||||
var opacity = Base.toFloat(value),
|
||||
color = item[name == 'fill-opacity'
|
||||
? 'getFillColor' : 'getStrokeColor']();
|
||||
if (color)
|
||||
color.setAlpha(opacity);
|
||||
break;
|
||||
case 'visibility':
|
||||
item.setVisible(value === 'visible');
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue