mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-22 12:21:51 +00:00
Build distribution
This commit is contained in:
parent
92b0d5e282
commit
4b1c58ca6e
4 changed files with 60 additions and 38 deletions
43
dist/fabric.js
vendored
43
dist/fabric.js
vendored
|
|
@ -5858,9 +5858,7 @@ fabric.Pattern = fabric.util.createClass(/** @lends fabric.Pattern.prototype */
|
|||
activeGroup.render(ctx);
|
||||
}
|
||||
|
||||
if (this.overlayImage) {
|
||||
ctx.drawImage(this.overlayImage, this.overlayImageLeft, this.overlayImageTop);
|
||||
}
|
||||
this._renderOverlay(ctx);
|
||||
|
||||
this.fire('after:render');
|
||||
|
||||
|
|
@ -10610,6 +10608,8 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati
|
|||
* @param {CanvasRenderingContext2D} ctx Context to render on
|
||||
*/
|
||||
_removeShadow: function(ctx) {
|
||||
if (!this.shadow) return;
|
||||
|
||||
ctx.shadowColor = '';
|
||||
ctx.shadowBlur = ctx.shadowOffsetX = ctx.shadowOffsetY = 0;
|
||||
},
|
||||
|
|
@ -13384,13 +13384,21 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
* @param ctx {CanvasRenderingContext2D} context to render on
|
||||
*/
|
||||
_render: function(ctx) {
|
||||
|
||||
// optimize 1x1 case (used in spray brush)
|
||||
if (this.width === 1 && this.height === 1) {
|
||||
ctx.fillRect(0, 0, 1, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
var rx = this.rx || 0,
|
||||
ry = this.ry || 0,
|
||||
x = -this.width / 2,
|
||||
y = -this.height / 2,
|
||||
w = this.width,
|
||||
h = this.height,
|
||||
isInPathGroup = this.group && this.group.type === 'path-group';
|
||||
x = -w / 2,
|
||||
y = -h / 2,
|
||||
isInPathGroup = this.group && this.group.type === 'path-group',
|
||||
isRounded = rx !== 0 || ry !== 0;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.globalAlpha = isInPathGroup ? (ctx.globalAlpha * this.opacity) : this.opacity;
|
||||
|
|
@ -13406,17 +13414,20 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
-this.group.height / 2 + this.height / 2 + this.y);
|
||||
}
|
||||
|
||||
var isRounded = rx !== 0 || ry !== 0;
|
||||
ctx.moveTo(x + rx, y);
|
||||
|
||||
ctx.lineTo(x + w - rx, y);
|
||||
isRounded && ctx.quadraticCurveTo(x + w, y, x + w, y + ry, x + w, y + ry);
|
||||
|
||||
ctx.lineTo(x + w, y + h - ry);
|
||||
isRounded && ctx.quadraticCurveTo(x + w, y + h, x + w - rx, y + h, x + w - rx, y + h);
|
||||
|
||||
ctx.lineTo(x + rx, y + h);
|
||||
isRounded && ctx.quadraticCurveTo(x, y + h, x, y + h - ry, x, y + h - ry);
|
||||
|
||||
ctx.lineTo(x, y + ry);
|
||||
isRounded && ctx.quadraticCurveTo(x, y, x + rx, y, x + rx, y);
|
||||
|
||||
ctx.moveTo(x+rx, y);
|
||||
ctx.lineTo(x+w-rx, y);
|
||||
isRounded && ctx.quadraticCurveTo(x+w, y, x+w, y+ry, x+w, y+ry);
|
||||
ctx.lineTo(x+w, y+h-ry);
|
||||
isRounded && ctx.quadraticCurveTo(x+w,y+h,x+w-rx,y+h,x+w-rx,y+h);
|
||||
ctx.lineTo(x+rx,y+h);
|
||||
isRounded && ctx.quadraticCurveTo(x,y+h,x,y+h-ry,x,y+h-ry);
|
||||
ctx.lineTo(x,y+ry);
|
||||
isRounded && ctx.quadraticCurveTo(x,y,x+rx,y,x+rx,y);
|
||||
ctx.closePath();
|
||||
|
||||
this._renderFill(ctx);
|
||||
|
|
|
|||
12
dist/fabric.min.js
vendored
12
dist/fabric.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/fabric.min.js.gz
vendored
BIN
dist/fabric.min.js.gz
vendored
Binary file not shown.
43
dist/fabric.require.js
vendored
43
dist/fabric.require.js
vendored
|
|
@ -5858,9 +5858,7 @@ fabric.Pattern = fabric.util.createClass(/** @lends fabric.Pattern.prototype */
|
|||
activeGroup.render(ctx);
|
||||
}
|
||||
|
||||
if (this.overlayImage) {
|
||||
ctx.drawImage(this.overlayImage, this.overlayImageLeft, this.overlayImageTop);
|
||||
}
|
||||
this._renderOverlay(ctx);
|
||||
|
||||
this.fire('after:render');
|
||||
|
||||
|
|
@ -10610,6 +10608,8 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati
|
|||
* @param {CanvasRenderingContext2D} ctx Context to render on
|
||||
*/
|
||||
_removeShadow: function(ctx) {
|
||||
if (!this.shadow) return;
|
||||
|
||||
ctx.shadowColor = '';
|
||||
ctx.shadowBlur = ctx.shadowOffsetX = ctx.shadowOffsetY = 0;
|
||||
},
|
||||
|
|
@ -13384,13 +13384,21 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
* @param ctx {CanvasRenderingContext2D} context to render on
|
||||
*/
|
||||
_render: function(ctx) {
|
||||
|
||||
// optimize 1x1 case (used in spray brush)
|
||||
if (this.width === 1 && this.height === 1) {
|
||||
ctx.fillRect(0, 0, 1, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
var rx = this.rx || 0,
|
||||
ry = this.ry || 0,
|
||||
x = -this.width / 2,
|
||||
y = -this.height / 2,
|
||||
w = this.width,
|
||||
h = this.height,
|
||||
isInPathGroup = this.group && this.group.type === 'path-group';
|
||||
x = -w / 2,
|
||||
y = -h / 2,
|
||||
isInPathGroup = this.group && this.group.type === 'path-group',
|
||||
isRounded = rx !== 0 || ry !== 0;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.globalAlpha = isInPathGroup ? (ctx.globalAlpha * this.opacity) : this.opacity;
|
||||
|
|
@ -13406,17 +13414,20 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
-this.group.height / 2 + this.height / 2 + this.y);
|
||||
}
|
||||
|
||||
var isRounded = rx !== 0 || ry !== 0;
|
||||
ctx.moveTo(x + rx, y);
|
||||
|
||||
ctx.lineTo(x + w - rx, y);
|
||||
isRounded && ctx.quadraticCurveTo(x + w, y, x + w, y + ry, x + w, y + ry);
|
||||
|
||||
ctx.lineTo(x + w, y + h - ry);
|
||||
isRounded && ctx.quadraticCurveTo(x + w, y + h, x + w - rx, y + h, x + w - rx, y + h);
|
||||
|
||||
ctx.lineTo(x + rx, y + h);
|
||||
isRounded && ctx.quadraticCurveTo(x, y + h, x, y + h - ry, x, y + h - ry);
|
||||
|
||||
ctx.lineTo(x, y + ry);
|
||||
isRounded && ctx.quadraticCurveTo(x, y, x + rx, y, x + rx, y);
|
||||
|
||||
ctx.moveTo(x+rx, y);
|
||||
ctx.lineTo(x+w-rx, y);
|
||||
isRounded && ctx.quadraticCurveTo(x+w, y, x+w, y+ry, x+w, y+ry);
|
||||
ctx.lineTo(x+w, y+h-ry);
|
||||
isRounded && ctx.quadraticCurveTo(x+w,y+h,x+w-rx,y+h,x+w-rx,y+h);
|
||||
ctx.lineTo(x+rx,y+h);
|
||||
isRounded && ctx.quadraticCurveTo(x,y+h,x,y+h-ry,x,y+h-ry);
|
||||
ctx.lineTo(x,y+ry);
|
||||
isRounded && ctx.quadraticCurveTo(x,y,x+rx,y,x+rx,y);
|
||||
ctx.closePath();
|
||||
|
||||
this._renderFill(ctx);
|
||||
|
|
|
|||
Loading…
Reference in a new issue