1
0
Fork 0

chore: Further tweaks to pattern events

This commit is contained in:
Joost De Cock 2020-07-19 13:01:01 +02:00
parent 53e8274624
commit 4ac64e05cb
11 changed files with 2558 additions and 955 deletions

View file

@ -11,8 +11,8 @@ import {
round
} from './utils'
function Path(raise = false) {
this.debug = raise ? true : false
function Path(debug = false) {
this.debug = debug
this.render = true
this.topLeft = false
this.bottomRight = false
@ -24,7 +24,7 @@ function Path(raise = false) {
Path.prototype.setRender = function (render = true) {
if (render) this.render = true
else this.render = false
if (this.debug) this.raise('Setting `Path.render` to ' + render ? '`true`' : '`false`')
if (this.debug) this.raise.debug('Setting `Path.render` to ' + render ? '`true`' : '`false`')
return this
}
@ -387,7 +387,9 @@ function joinPaths(paths, closed = false) {
// We're using sitsRoughlyOn here to avoid miniscule line segments
if (current && !op.to.sitsRoughlyOn(current)) joint.line(op.to)
} else {
throw new Error('Cannot join a closed paths with another')
let err = 'Cannot join a closed path with another'
this.raise.error(err)
throw new Error(err)
}
if (op.to) current = op.to
}