mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Improve Path#moveTo behavior()
Allowing it to be called multiple times before any other drawing commands.
This commit is contained in:
parent
693b2f3af1
commit
07c0b6ce6a
1 changed files with 5 additions and 0 deletions
|
@ -1654,6 +1654,11 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
|||
// are considered abstract methods of PathItem and need to be defined in
|
||||
// all implementing classes.
|
||||
moveTo: function(point) {
|
||||
// moveTo should only be called at the beginning of paths. But it
|
||||
// can ce called again if there is nothing drawn yet, in which case
|
||||
// the first segment gets readjusted.
|
||||
if (this._segments.length === 1)
|
||||
this.removeSegment(0);
|
||||
// Let's not be picky about calling moveTo() when not at the
|
||||
// beginning of a path, just bail out:
|
||||
if (!this._segments.length)
|
||||
|
|
Loading…
Reference in a new issue