Make Item#draw() protected, so we know to not directly call it.

This commit is contained in:
Jürg Lehni 2013-04-18 16:58:35 -07:00
parent d1c6b7134f
commit d23e21edd7
7 changed files with 7 additions and 7 deletions

View file

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

View file

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

View file

@ -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);
}

View file

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

View file

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

View file

@ -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();

View file

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