From d23e21edd7fc08b32d2a0613e9c4f61e32a61188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 18 Apr 2013 16:58:35 -0700 Subject: [PATCH] Make Item#draw() protected, so we know to not directly call it. --- src/item/Group.js | 2 +- src/item/Item.js | 2 +- src/item/PlacedSymbol.js | 2 +- src/item/Raster.js | 2 +- src/path/CompoundPath.js | 2 +- src/path/Path.js | 2 +- src/text/PointText.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/item/Group.js b/src/item/Group.js index 5feb83b5..c74a8b7e 100644 --- a/src/item/Group.js +++ b/src/item/Group.js @@ -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; diff --git a/src/item/Item.js b/src/item/Item.js index 58d8e8e9..64a59f0c 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -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) diff --git a/src/item/PlacedSymbol.js b/src/item/PlacedSymbol.js index 2fdf2e60..004f5e13 100644 --- a/src/item/PlacedSymbol.js +++ b/src/item/PlacedSymbol.js @@ -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); } diff --git a/src/item/Raster.js b/src/item/Raster.js index 6883d646..72b64579 100644 --- a/src/item/Raster.js +++ b/src/item/Raster.js @@ -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 diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index 0e960e30..20f81743 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -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: diff --git a/src/path/Path.js b/src/path/Path.js index 0ab5cae0..5e905dc7 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -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(); diff --git a/src/text/PointText.js b/src/text/PointText.js index aa5a384d..a46d63fe 100644 --- a/src/text/PointText.js +++ b/src/text/PointText.js @@ -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);