mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-24 20:59:02 -04:00
Actually fix handling of param.clip in Path#draw.
This commit is contained in:
parent
4c4258d2e1
commit
e5c32b9520
1 changed files with 4 additions and 3 deletions
|
@ -1840,18 +1840,19 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
strokeColor = style._strokeColor,
|
strokeColor = style._strokeColor,
|
||||||
dashArray = style._dashArray,
|
dashArray = style._dashArray,
|
||||||
drawDash = !paper.support.nativeDash && strokeColor
|
drawDash = !paper.support.nativeDash && strokeColor
|
||||||
&& dashArray && dashArray.length;
|
&& dashArray && dashArray.length,
|
||||||
|
clip = param.clip || this._clipMask;
|
||||||
|
|
||||||
// Prepare the canvas path if we have any situation that requires it
|
// Prepare the canvas path if we have any situation that requires it
|
||||||
// to be defined.
|
// to be defined.
|
||||||
if (param.compound || this._clipMask || fillColor || strokeColor
|
if (param.compound || clip || fillColor || strokeColor
|
||||||
&& !drawDash)
|
&& !drawDash)
|
||||||
drawSegments(ctx, this);
|
drawSegments(ctx, this);
|
||||||
|
|
||||||
if (this._closed)
|
if (this._closed)
|
||||||
ctx.closePath();
|
ctx.closePath();
|
||||||
|
|
||||||
if (param.clip || this._clipMask) {
|
if (clip) {
|
||||||
ctx.clip();
|
ctx.clip();
|
||||||
} else if (!param.compound && (fillColor || strokeColor)) {
|
} else if (!param.compound && (fillColor || strokeColor)) {
|
||||||
// If the path is part of a compound path or doesn't have a fill
|
// If the path is part of a compound path or doesn't have a fill
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue