We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.2.3
Kitchen Sink:
Add a shadow to an object in kitchen sink demo. Then show SVG (in Safari). Opacity of the shadow is wrong.
Same shadow canvas/svg
Different shadow opacity
Use flood-opacity instead in toSVG() function (see in the return line above)
toSVG: function(object) { var fBoxX = 40, fBoxY = 40, NUM_FRACTION_DIGITS = fabric.Object.NUM_FRACTION_DIGITS, offset = fabric.util.rotateVector({ x: this.offsetX, y: this.offsetY }, fabric.util.degreesToRadians(-object.angle)), BLUR_BOX = 20; if (object.width && object.height) { fBoxX = toFixed((Math.abs(offset.x) + this.blur) / object.width, NUM_FRACTION_DIGITS) * 100 + BLUR_BOX; fBoxY = toFixed((Math.abs(offset.y) + this.blur) / object.height, NUM_FRACTION_DIGITS) * 100 + BLUR_BOX; } if (object.flipX) { offset.x *= -1; } if (object.flipY) { offset.y *= -1; } var color = new fabric.Color(this.color); return '<filter color-interpolation-filters="linearRGB" id="SVGID_' + this.id + '" y="-' + fBoxY + '%" height="' + (100 + 2 * fBoxY) + '%" ' + 'x="-' + fBoxX + '%" width="' + (100 + 2 * fBoxX) + '%" ' + ">\n" + '\t<feGaussianBlur in="SourceAlpha" stdDeviation="' + toFixed(this.blur ? this.blur / 2 : 0, NUM_FRACTION_DIGITS) + '"></feGaussianBlur>\n' + '\t<feOffset dx="' + toFixed(offset.x, NUM_FRACTION_DIGITS) + '" dy="' + toFixed(offset.y, NUM_FRACTION_DIGITS) + '" result="oBlur" ></feOffset>\n' + '\t<feFlood flood-color="' + color.toRgb() + '" flood-opacity="' + color.getAlpha() + '" />\n' + '\t<feComposite in2="oBlur" operator="in" />\n' + "\t<feMerge>\n" + "\t\t<feMergeNode></feMergeNode>\n" + '\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n' + "\t</feMerge>\n" + "</filter>\n"; },
The text was updated successfully, but these errors were encountered:
going to check this!
Sorry, something went wrong.
it works!
Successfully merging a pull request may close this issue.
Version
2.2.3
Test Case
Kitchen Sink:

Steps to reproduce
Add a shadow to an object in kitchen sink demo. Then show SVG (in Safari). Opacity of the shadow is wrong.
Expected Behavior
Same shadow canvas/svg
Actual Behavior
Different shadow opacity
Proposed solution
Use flood-opacity instead in toSVG() function (see in the return line above)
The text was updated successfully, but these errors were encountered: