mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Make Item#draw() protected, so we know to not directly call it.
This commit is contained in:
parent
d1c6b7134f
commit
d23e21edd7
7 changed files with 7 additions and 7 deletions
|
@ -164,7 +164,7 @@ var Group = this.Group = Item.extend(/** @lends Group# */{
|
||||||
child.setClipMask(clipped);
|
child.setClipMask(clipped);
|
||||||
},
|
},
|
||||||
|
|
||||||
draw: function(ctx, param) {
|
_draw: function(ctx, param) {
|
||||||
var clipItem = this._getClipItem();
|
var clipItem = this._getClipItem();
|
||||||
if (clipItem) {
|
if (clipItem) {
|
||||||
param.clip = true;
|
param.clip = true;
|
||||||
|
|
|
@ -2838,7 +2838,7 @@ var Item = this.Item = Base.extend(Callback, {
|
||||||
ctx.translate(-itemOffset.x, -itemOffset.y);
|
ctx.translate(-itemOffset.x, -itemOffset.y);
|
||||||
// Apply globalMatrix when blitting into temporary canvas.
|
// Apply globalMatrix when blitting into temporary canvas.
|
||||||
(parentCtx ? globalMatrix : item._matrix).applyToContext(ctx);
|
(parentCtx ? globalMatrix : item._matrix).applyToContext(ctx);
|
||||||
item.draw(ctx, param);
|
item._draw(ctx, param);
|
||||||
ctx.restore();
|
ctx.restore();
|
||||||
transforms.pop();
|
transforms.pop();
|
||||||
if (param.clip)
|
if (param.clip)
|
||||||
|
|
|
@ -110,7 +110,7 @@ var PlacedSymbol = this.PlacedSymbol = PlacedItem.extend(/** @lends PlacedSymbol
|
||||||
return this.symbol._definition._getCachedBounds(getter, matrix);
|
return this.symbol._definition._getCachedBounds(getter, matrix);
|
||||||
},
|
},
|
||||||
|
|
||||||
draw: function(ctx, param) {
|
_draw: function(ctx, param) {
|
||||||
Item.draw(this.symbol._definition, ctx, param);
|
Item.draw(this.symbol._definition, ctx, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -537,7 +537,7 @@ var Raster = this.Raster = PlacedItem.extend(/** @lends Raster# */{
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
draw: function(ctx, param) {
|
_draw: function(ctx) {
|
||||||
var element = this.getElement();
|
var element = this.getElement();
|
||||||
if (element) {
|
if (element) {
|
||||||
// Handle opacity for Rasters separately from the rest, since
|
// Handle opacity for Rasters separately from the rest, since
|
||||||
|
|
|
@ -195,7 +195,7 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath#
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|
||||||
draw: function(ctx, param) {
|
_draw: function(ctx, param) {
|
||||||
var children = this._children,
|
var children = this._children,
|
||||||
style = this._style;
|
style = this._style;
|
||||||
// Return early if the compound path doesn't have any children:
|
// Return early if the compound path doesn't have any children:
|
||||||
|
|
|
@ -1828,7 +1828,7 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
draw: function(ctx, param) {
|
_draw: function(ctx, param) {
|
||||||
if (!param.compound)
|
if (!param.compound)
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ var PointText = this.PointText = TextItem.extend(/** @lends PointText# */{
|
||||||
this._matrix.getTranslation()));
|
this._matrix.getTranslation()));
|
||||||
},
|
},
|
||||||
|
|
||||||
draw: function(ctx) {
|
_draw: function(ctx) {
|
||||||
if (!this._content)
|
if (!this._content)
|
||||||
return;
|
return;
|
||||||
this._setStyles(ctx);
|
this._setStyles(ctx);
|
||||||
|
|
Loading…
Reference in a new issue