Prebuilt module for commit a43db8427a

This commit is contained in:
Paper.js Bot 2017-03-22 22:50:29 +00:00
parent 5e9b75eb4d
commit 19e047ae74
8 changed files with 65 additions and 53 deletions

View file

@ -9,7 +9,7 @@
*
* All rights reserved.
*
* Date: Wed Mar 22 23:26:26 2017 +0100
* Date: Wed Mar 22 23:45:11 2017 +0100
*
***
*
@ -9820,7 +9820,7 @@ PathItem.inject(new function() {
function traceBoolean(path1, path2, operation, options) {
if (options && (options.trace == false || options.stroke) &&
/^(subtract|intersect)$/.test(operation))
return splitBoolean(path1, path2, operation === 'subtract');
return splitBoolean(path1, path2, operation);
var _path1 = preparePath(path1, true),
_path2 = path2 && path1 !== path2 && preparePath(path2, true),
operator = operators[operation];
@ -9874,17 +9874,19 @@ PathItem.inject(new function() {
return createResult(paths, true, path1, path2, options);
}
function splitBoolean(path1, path2, subtract) {
function splitBoolean(path1, path2, operation) {
var _path1 = preparePath(path1),
_path2 = preparePath(path2),
crossings = _path1.getCrossings(_path2),
added = {},
paths = [];
paths = [],
divide = operation === 'divide',
subtract = operation === 'subtract';
function addPath(path) {
if (!added[path._id] &&
if (!added[path._id] && (divide ||
_path2.contains(path.getPointAt(path.getLength() / 2))
^ subtract) {
^ subtract)) {
paths.unshift(path);
return added[path._id] = true;
}
@ -10457,10 +10459,12 @@ PathItem.inject(new function() {
},
divide: function(path, options) {
return createResult([
this.subtract(path, options),
this.intersect(path, options)
], true, this, path, options);
return options && (options.trace == false || options.stroke)
? splitBoolean(this, path, 'divide')
: createResult([
this.subtract(path, options),
this.intersect(path, options)
], true, this, path, options);
},
resolveCrossings: function() {

View file

@ -6760,7 +6760,7 @@ function onMouseDown(event) {
<ul class="member-list">
<h4>Options:</h4>
<li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
<li><tt>options.stroke: <tt>Boolean</tt></tt> &mdash; whether the operation should be performed on the stroke or on the fill of the first path &mdash;&nbsp;default: <tt>false</tt></li>
<li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating both paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections, keeping the parts of the curves that intersect with the area of the second path. &mdash;&nbsp;default: <tt>true</tt></li>
</ul>
<ul class="member-list">
@ -6812,7 +6812,7 @@ function onMouseDown(event) {
<ul class="member-list">
<h4>Options:</h4>
<li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
<li><tt>options.stroke: <tt>Boolean</tt></tt> &mdash; whether the operation should be performed on the stroke or on the fill of the first path &mdash;&nbsp;default: <tt>false</tt></li>
<li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating both paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections, removing the parts of the curves that intersect with the area of the second path. &mdash;&nbsp;default: <tt>true</tt></li>
</ul>
<ul class="member-list">
@ -6890,7 +6890,7 @@ function onMouseDown(event) {
<h4>Returns:</h4>
<li>
<tt><a href="../classes/PathItem.html"><tt>PathItem</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting group item
<tt><a href="../classes/PathItem.html"><tt>PathItem</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting path item
</li>
@ -6915,7 +6915,7 @@ function onMouseDown(event) {
<ul class="member-list">
<h4>Options:</h4>
<li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
<li><tt>options.stroke: <tt>Boolean</tt></tt> &mdash; whether the operation should be performed on the stroke or on the fill of the first path &mdash;&nbsp;default: <tt>false</tt></li>
<li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating both paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections. &mdash;&nbsp;default: <tt>true</tt></li>
</ul>
<ul class="member-list">
@ -6942,7 +6942,7 @@ function onMouseDown(event) {
<h4>Returns:</h4>
<li>
<tt><a href="../classes/Group.html"><tt>Group</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting group item
<tt><a href="../classes/PathItem.html"><tt>PathItem</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting path item
</li>

View file

@ -9614,7 +9614,7 @@ function onMouseDown(event) {
<ul class="member-list">
<h4>Options:</h4>
<li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
<li><tt>options.stroke: <tt>Boolean</tt></tt> &mdash; whether the operation should be performed on the stroke or on the fill of the first path &mdash;&nbsp;default: <tt>false</tt></li>
<li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating both paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections, keeping the parts of the curves that intersect with the area of the second path. &mdash;&nbsp;default: <tt>true</tt></li>
</ul>
<ul class="member-list">
@ -9666,7 +9666,7 @@ function onMouseDown(event) {
<ul class="member-list">
<h4>Options:</h4>
<li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
<li><tt>options.stroke: <tt>Boolean</tt></tt> &mdash; whether the operation should be performed on the stroke or on the fill of the first path &mdash;&nbsp;default: <tt>false</tt></li>
<li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating both paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections, removing the parts of the curves that intersect with the area of the second path. &mdash;&nbsp;default: <tt>true</tt></li>
</ul>
<ul class="member-list">
@ -9744,7 +9744,7 @@ function onMouseDown(event) {
<h4>Returns:</h4>
<li>
<tt><a href="../classes/PathItem.html"><tt>PathItem</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting group item
<tt><a href="../classes/PathItem.html"><tt>PathItem</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting path item
</li>
@ -9769,7 +9769,7 @@ function onMouseDown(event) {
<ul class="member-list">
<h4>Options:</h4>
<li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
<li><tt>options.stroke: <tt>Boolean</tt></tt> &mdash; whether the operation should be performed on the stroke or on the fill of the first path &mdash;&nbsp;default: <tt>false</tt></li>
<li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating both paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections. &mdash;&nbsp;default: <tt>true</tt></li>
</ul>
<ul class="member-list">
@ -9796,7 +9796,7 @@ function onMouseDown(event) {
<h4>Returns:</h4>
<li>
<tt><a href="../classes/Group.html"><tt>Group</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting group item
<tt><a href="../classes/PathItem.html"><tt>PathItem</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting path item
</li>

View file

@ -192,7 +192,7 @@
<ul class="member-list">
<h4>Options:</h4>
<li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
<li><tt>options.stroke: <tt>Boolean</tt></tt> &mdash; whether the operation should be performed on the stroke or on the fill of the first path &mdash;&nbsp;default: <tt>false</tt></li>
<li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating both paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections, keeping the parts of the curves that intersect with the area of the second path. &mdash;&nbsp;default: <tt>true</tt></li>
</ul>
<ul class="member-list">
@ -244,7 +244,7 @@
<ul class="member-list">
<h4>Options:</h4>
<li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
<li><tt>options.stroke: <tt>Boolean</tt></tt> &mdash; whether the operation should be performed on the stroke or on the fill of the first path &mdash;&nbsp;default: <tt>false</tt></li>
<li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating both paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections, removing the parts of the curves that intersect with the area of the second path. &mdash;&nbsp;default: <tt>true</tt></li>
</ul>
<ul class="member-list">
@ -322,7 +322,7 @@
<h4>Returns:</h4>
<li>
<tt><a href="../classes/PathItem.html"><tt>PathItem</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting group item
<tt><a href="../classes/PathItem.html"><tt>PathItem</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting path item
</li>
@ -347,7 +347,7 @@
<ul class="member-list">
<h4>Options:</h4>
<li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
<li><tt>options.stroke: <tt>Boolean</tt></tt> &mdash; whether the operation should be performed on the stroke or on the fill of the first path &mdash;&nbsp;default: <tt>false</tt></li>
<li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating both paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections. &mdash;&nbsp;default: <tt>true</tt></li>
</ul>
<ul class="member-list">
@ -374,7 +374,7 @@
<h4>Returns:</h4>
<li>
<tt><a href="../classes/Group.html"><tt>Group</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting group item
<tt><a href="../classes/PathItem.html"><tt>PathItem</tt></a></tt>&nbsp;&mdash;&nbsp;the resulting path item
</li>

24
dist/paper-core.js vendored
View file

@ -9,7 +9,7 @@
*
* All rights reserved.
*
* Date: Wed Mar 22 23:26:26 2017 +0100
* Date: Wed Mar 22 23:45:11 2017 +0100
*
***
*
@ -9820,7 +9820,7 @@ PathItem.inject(new function() {
function traceBoolean(path1, path2, operation, options) {
if (options && (options.trace == false || options.stroke) &&
/^(subtract|intersect)$/.test(operation))
return splitBoolean(path1, path2, operation === 'subtract');
return splitBoolean(path1, path2, operation);
var _path1 = preparePath(path1, true),
_path2 = path2 && path1 !== path2 && preparePath(path2, true),
operator = operators[operation];
@ -9874,17 +9874,19 @@ PathItem.inject(new function() {
return createResult(paths, true, path1, path2, options);
}
function splitBoolean(path1, path2, subtract) {
function splitBoolean(path1, path2, operation) {
var _path1 = preparePath(path1),
_path2 = preparePath(path2),
crossings = _path1.getCrossings(_path2),
added = {},
paths = [];
paths = [],
divide = operation === 'divide',
subtract = operation === 'subtract';
function addPath(path) {
if (!added[path._id] &&
if (!added[path._id] && (divide ||
_path2.contains(path.getPointAt(path.getLength() / 2))
^ subtract) {
^ subtract)) {
paths.unshift(path);
return added[path._id] = true;
}
@ -10457,10 +10459,12 @@ PathItem.inject(new function() {
},
divide: function(path, options) {
return createResult([
this.subtract(path, options),
this.intersect(path, options)
], true, this, path, options);
return options && (options.trace == false || options.stroke)
? splitBoolean(this, path, 'divide')
: createResult([
this.subtract(path, options),
this.intersect(path, options)
], true, this, path, options);
},
resolveCrossings: function() {

File diff suppressed because one or more lines are too long

24
dist/paper-full.js vendored
View file

@ -9,7 +9,7 @@
*
* All rights reserved.
*
* Date: Wed Mar 22 23:26:26 2017 +0100
* Date: Wed Mar 22 23:45:11 2017 +0100
*
***
*
@ -9820,7 +9820,7 @@ PathItem.inject(new function() {
function traceBoolean(path1, path2, operation, options) {
if (options && (options.trace == false || options.stroke) &&
/^(subtract|intersect)$/.test(operation))
return splitBoolean(path1, path2, operation === 'subtract');
return splitBoolean(path1, path2, operation);
var _path1 = preparePath(path1, true),
_path2 = path2 && path1 !== path2 && preparePath(path2, true),
operator = operators[operation];
@ -9874,17 +9874,19 @@ PathItem.inject(new function() {
return createResult(paths, true, path1, path2, options);
}
function splitBoolean(path1, path2, subtract) {
function splitBoolean(path1, path2, operation) {
var _path1 = preparePath(path1),
_path2 = preparePath(path2),
crossings = _path1.getCrossings(_path2),
added = {},
paths = [];
paths = [],
divide = operation === 'divide',
subtract = operation === 'subtract';
function addPath(path) {
if (!added[path._id] &&
if (!added[path._id] && (divide ||
_path2.contains(path.getPointAt(path.getLength() / 2))
^ subtract) {
^ subtract)) {
paths.unshift(path);
return added[path._id] = true;
}
@ -10457,10 +10459,12 @@ PathItem.inject(new function() {
},
divide: function(path, options) {
return createResult([
this.subtract(path, options),
this.intersect(path, options)
], true, this, path, options);
return options && (options.trace == false || options.stroke)
? splitBoolean(this, path, 'divide')
: createResult([
this.subtract(path, options),
this.intersect(path, options)
], true, this, path, options);
},
resolveCrossings: function() {

File diff suppressed because one or more lines are too long