mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -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);
|
||||
},
|
||||
|
||||
draw: function(ctx, param) {
|
||||
_draw: function(ctx, param) {
|
||||
var clipItem = this._getClipItem();
|
||||
if (clipItem) {
|
||||
param.clip = true;
|
||||
|
|
|
@ -2838,7 +2838,7 @@ var Item = this.Item = Base.extend(Callback, {
|
|||
ctx.translate(-itemOffset.x, -itemOffset.y);
|
||||
// Apply globalMatrix when blitting into temporary canvas.
|
||||
(parentCtx ? globalMatrix : item._matrix).applyToContext(ctx);
|
||||
item.draw(ctx, param);
|
||||
item._draw(ctx, param);
|
||||
ctx.restore();
|
||||
transforms.pop();
|
||||
if (param.clip)
|
||||
|
|
|
@ -110,7 +110,7 @@ var PlacedSymbol = this.PlacedSymbol = PlacedItem.extend(/** @lends PlacedSymbol
|
|||
return this.symbol._definition._getCachedBounds(getter, matrix);
|
||||
},
|
||||
|
||||
draw: function(ctx, param) {
|
||||
_draw: function(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();
|
||||
if (element) {
|
||||
// Handle opacity for Rasters separately from the rest, since
|
||||
|
|
|
@ -195,7 +195,7 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath#
|
|||
return res;
|
||||
},
|
||||
|
||||
draw: function(ctx, param) {
|
||||
_draw: function(ctx, param) {
|
||||
var children = this._children,
|
||||
style = this._style;
|
||||
// Return early if the compound path doesn't have any children:
|
||||
|
|
|
@ -1828,7 +1828,7 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
|||
}
|
||||
|
||||
return {
|
||||
draw: function(ctx, param) {
|
||||
_draw: function(ctx, param) {
|
||||
if (!param.compound)
|
||||
ctx.beginPath();
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ var PointText = this.PointText = TextItem.extend(/** @lends PointText# */{
|
|||
this._matrix.getTranslation()));
|
||||
},
|
||||
|
||||
draw: function(ctx) {
|
||||
_draw: function(ctx) {
|
||||
if (!this._content)
|
||||
return;
|
||||
this._setStyles(ctx);
|
||||
|
|
Loading…
Reference in a new issue