summaryrefslogtreecommitdiff
path: root/paint.js
diff options
context:
space:
mode:
authorNathan Dinsmore <nathan@users.noreply.github.com>2015-06-17 17:11:40 -0400
committerNathan Dinsmore <nathan@users.noreply.github.com>2015-06-17 17:11:40 -0400
commit87c2503571bd7f5e753bc16a05bd198fc58d7d7c (patch)
tree4545f569b3989ee1d2e5d1cc3e3f31108ea06742 /paint.js
parent3885ced35aee903f74d48c293bc3f0665a38dba5 (diff)
downloadsnap-87c2503571bd7f5e753bc16a05bd198fc58d7d7c.tar.gz
snap-87c2503571bd7f5e753bc16a05bd198fc58d7d7c.zip
Use Object.create(…) instead of new …() for inheritance (faster)
Diffstat (limited to 'paint.js')
-rw-r--r--paint.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/paint.js b/paint.js
index 65ae1f6..b4c55b1 100644
--- a/paint.js
+++ b/paint.js
@@ -81,7 +81,7 @@ var PaintColorPickerMorph;
// A complete paint editor
-PaintEditorMorph.prototype = new DialogBoxMorph();
+PaintEditorMorph.prototype = Object.create(DialogBoxMorph.prototype);
PaintEditorMorph.prototype.constructor = PaintEditorMorph;
PaintEditorMorph.uber = DialogBoxMorph.prototype;
@@ -476,7 +476,7 @@ PaintEditorMorph.prototype.getUserColor = function () {
// A large hsl color picker
-PaintColorPickerMorph.prototype = new Morph();
+PaintColorPickerMorph.prototype = Object.create(Morph.prototype);
PaintColorPickerMorph.prototype.constructor = PaintColorPickerMorph;
PaintColorPickerMorph.uber = Morph.prototype;
@@ -552,7 +552,7 @@ PaintColorPickerMorph.prototype.mouseMove =
modify its image, based on a 'tool' property.
*/
-PaintCanvasMorph.prototype = new Morph();
+PaintCanvasMorph.prototype = Object.create(Morph.prototype);
PaintCanvasMorph.prototype.constructor = PaintCanvasMorph;
PaintCanvasMorph.uber = Morph.prototype;