|
919 | 919 | if (this.style('visibility').value == 'hidden') return;
|
920 | 920 |
|
921 | 921 | ctx.save();
|
922 |
| - if (this.style('mask').hasValue()) { // mask |
923 |
| - var mask = this.style('mask').getDefinition(); |
924 |
| - if (mask != null) mask.apply(ctx, this); |
925 |
| - } else if (this.style('filter').hasValue()) { // filter |
926 |
| - var filter = this.style('filter').getDefinition(); |
927 |
| - if (filter != null) filter.apply(ctx, this); |
928 |
| - } else { |
929 |
| - this.setContext(ctx); |
930 |
| - this.renderChildren(ctx); |
931 |
| - this.clearContext(ctx); |
932 |
| - } |
| 922 | + //ss |
| 923 | + try { |
| 924 | + if (this.style('mask').hasValue()) { // mask |
| 925 | + var mask = this.style('mask').getDefinition(); |
| 926 | + if (mask != null) mask.apply(ctx, this); |
| 927 | + } else if (this.style('filter').hasValue()) { // filter |
| 928 | + var filter = this.style('filter').getDefinition(); |
| 929 | + if (filter != null) filter.apply(ctx, this); |
| 930 | + } else { |
| 931 | + this.setContext(ctx); |
| 932 | + this.renderChildren(ctx); |
| 933 | + this.clearContext(ctx); |
| 934 | + } |
| 935 | + } catch (e) { |
| 936 | + console.warn('A rendering error occurred and was ignored.'); |
| 937 | + } |
| 938 | + //ss end |
933 | 939 | ctx.restore();
|
934 | 940 | }
|
935 | 941 |
|
|
3119 | 3125 | this.base = svg.Element.ElementBase;
|
3120 | 3126 | this.base(node);
|
3121 | 3127 |
|
3122 |
| - this.blurRadius = Math.floor(this.attribute('stdDeviation').numValue()); |
| 3128 | + //ss IE was returning a GIANT value for stdDeviation |
| 3129 | + var stdDev = this.attribute('stdDeviation').numValue(); |
| 3130 | + if (stdDev > 1000) { |
| 3131 | + stdDev = |
| 3132 | + //ss IE was mangling name from stdDeviation2 to stddeviation2 |
| 3133 | + this.attribute('stddeviation2').value !== '' |
| 3134 | + ? this.attribute('stddeviation2').numValue() |
| 3135 | + : 2; //TODO provide default value as an option |
| 3136 | + } |
| 3137 | + |
| 3138 | + this.blurRadius = Math.floor(stdDev); |
| 3139 | + //ss end |
3123 | 3140 | this.extraFilterDistance = this.blurRadius;
|
3124 | 3141 |
|
3125 | 3142 | this.apply = function(ctx, x, y, width, height) {
|
| 3143 | + //ss IE was not finding stackBlur using v1.4 |
| 3144 | + if (stackBlur === undefined && window.StackBlur !== undefined){ |
| 3145 | + stackBlur = window.StackBlur; |
| 3146 | + } |
| 3147 | + //ss end |
3126 | 3148 | if (typeof stackBlur.canvasRGBA == 'undefined') {
|
3127 | 3149 | svg.log('ERROR: StackBlur.js must be included for blur to work');
|
3128 | 3150 | return;
|
|
0 commit comments