diff --git a/js/model/FrameSheet.js b/js/model/FrameSheet.js index 852fa0fd..bfdc2a6f 100644 --- a/js/model/FrameSheet.js +++ b/js/model/FrameSheet.js @@ -1,6 +1,8 @@ (function () { var ns = $.namespace("pskl.model"); - ns.FrameSheet = function () { + ns.FrameSheet = function (width, height) { + this.width = width; + this.height = height; this.frames = []; }; @@ -9,7 +11,7 @@ }; ns.FrameSheet.prototype.addEmptyFrame = function () { - this.addFrame(ns.Frame.createEmpty(width, height)); + this.addFrame(ns.Frame.createEmpty(this.width, this.height)); }; ns.FrameSheet.prototype.addFrame = function (frame) { diff --git a/js/piskel.js b/js/piskel.js index 58d2260b..6076dfb7 100644 --- a/js/piskel.js +++ b/js/piskel.js @@ -50,13 +50,11 @@ $.namespace("pskl"); var piskel = { init : function () { - var emptyFrame = pskl.model.Frame.createEmpty(framePixelWidth, framePixelHeight); - - frameSheet = new pskl.model.FrameSheet(); - frameSheet.addFrame(emptyFrame); + frameSheet = new pskl.model.FrameSheet(framePixelWidth, framePixelHeight); + frameSheet.addEmptyFrame(); this.drawingController = new pskl.controller.DrawingController( - emptyFrame, + frameSheet.getFrameByIndex(0), $('#drawing-canvas-container')[0], drawingCanvasDpi ); @@ -253,7 +251,7 @@ $.namespace("pskl"); penColor, this.drawingController ); - + // TODO: Remove that when we have the centralized redraw loop this.previewsController.createPreviews(); }