Skip to content

Commit

Permalink
Merge pull request #2405 from Motionden/fix/circle-stroke-clipped
Browse files Browse the repository at this point in the history
Fix unintentional stroke clipping on shapes with large stroke-width
  • Loading branch information
bodymovin authored Feb 18, 2021
2 parents 1621a68 + 3a35a1c commit 1067722
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion player/js/elements/svgElements/SVGEffects.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function SVGEffects(elem) {
var i;
var len = elem.data.ef ? elem.data.ef.length : 0;
var filId = createElementID();
var fil = filtersFactory.createFilter(filId);
var fil = filtersFactory.createFilter(filId, true);
var count = 0;
this.filters = [];
var filterManager;
Expand Down
14 changes: 8 additions & 6 deletions player/js/utils/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ var filtersFactory = (function () {
ob.createFilter = createFilter;
ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;

function createFilter(filId) {
function createFilter(filId, skipCoordinates) {
var fil = createNS('filter');
fil.setAttribute('id', filId);
fil.setAttribute('filterUnits', 'objectBoundingBox');
fil.setAttribute('x', '0%');
fil.setAttribute('y', '0%');
fil.setAttribute('width', '100%');
fil.setAttribute('height', '100%');
if (skipCoordinates !== true) {
fil.setAttribute('filterUnits', 'objectBoundingBox');
fil.setAttribute('x', '0%');
fil.setAttribute('y', '0%');
fil.setAttribute('width', '100%');
fil.setAttribute('height', '100%');
}
return fil;
}

Expand Down

0 comments on commit 1067722

Please sign in to comment.