Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix #36

A bug in svg-renderer where filters couldn't be removed.
  • Loading branch information...
commit c1c3e23dbb360583193b568778944facc6cfaef6 1 parent 5300234
@basecode basecode authored
Showing with 11 additions and 7 deletions.
  1. +1 −0  CHANGELOG
  2. +10 −7 src/renderer/svg/svg.js
View
1  CHANGELOG
@@ -7,6 +7,7 @@ v0.3.4
* Fix #33 where `null` should be passed instead of `undefined`
as second parameter to `parent.insertBefore` (thx @jdalton)
* Add `diffX` and `diffY` properties to `pointerup` event object.
+* Fix #36 where filters couldn't be removed (thx @qfox)
v0.3.3
-------------------
View
17 src/renderer/svg/svg.js
@@ -69,6 +69,9 @@ define([
'mousewheel'
];
+ // tools
+ var isArray = tools.isArray;
+
var xlink = 'http://www.w3.org/1999/xlink';
function createElement(n, id) {
@@ -407,11 +410,10 @@ define([
*/
proto.drawAll = function(type, element, message) {
- var hasFilters = false;
var attr = message.attributes;
+ var filters = attr.filters;
var fillColor = attr.fillColor;
var fillGradient = attr.fillGradient;
- var filters = attr.filters || [];
var svg = this.svg;
// when filter is applied, force fillColor change on UA w/o SVG Filter support
@@ -419,12 +421,13 @@ define([
fillColor = element._fillColorSignature;
}
- if (filters.length) {
- hasFilters = true;
- this.applyFilters(element, filters);
- } else if (filters === null) {
- element._filterSignature &&
+ if (isArray(filters)) {
+ // modify filters
+ if (filters.length > 0) {
+ this.applyFilters(element, filters);
+ } else {
this.removeFilters(element);
+ }
}
if (message.offStageType === 'clip') {
Please sign in to comment.
Something went wrong with that request. Please try again.