Actually fix handling of param.clip in Path#draw.

This commit is contained in:
Jonathan Puckey 2013-03-17 21:59:07 +01:00
parent 4c4258d2e1
commit e5c32b9520

View file

@ -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