Skip to content

Commit

Permalink
Merge pull request #1 from slotDumpling/split-boolean-options
Browse files Browse the repository at this point in the history
passing the parameter "options" to the function " splitBoolean"
  • Loading branch information
slotDumpling authored Apr 22, 2023
2 parents ea3d8a1 + 77fc868 commit 286e2c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/path/PathItem.Boolean.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ PathItem.inject(new function() {
// based boolean operations (options.split = true).
if (options && (options.trace == false || options.stroke) &&
/^(subtract|intersect)$/.test(operation))
return splitBoolean(path1, path2, operation);
return splitBoolean(path1, path2, operation, options);
// We do not modify the operands themselves, but create copies instead,
// fas produced by the calls to preparePath().
// NOTE: The result paths might not belong to the same type i.e.
Expand Down Expand Up @@ -215,7 +215,7 @@ PathItem.inject(new function() {
return createResult(paths, true, path1, path2, options);
}

function splitBoolean(path1, path2, operation) {
function splitBoolean(path1, path2, operation, options) {
var _path1 = preparePath(path1),
_path2 = preparePath(path2),
crossings = _path1.getIntersections(_path2, filterIntersection),
Expand Down Expand Up @@ -251,7 +251,7 @@ PathItem.inject(new function() {
}
// At the end, add what's left from our path after all the splitting.
addPath(_path1);
return createResult(paths, false, path1, path2);
return createResult(paths, false, path1, path2, options);
}

/*
Expand Down Expand Up @@ -1220,7 +1220,7 @@ PathItem.inject(new function() {
*/
divide: function(path, options) {
return options && (options.trace == false || options.stroke)
? splitBoolean(this, path, 'divide')
? splitBoolean(this, path, 'divide', options)
: createResult([
this.subtract(path, options),
this.intersect(path, options)
Expand Down

0 comments on commit 286e2c0

Please sign in to comment.