mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
fixed add button
This commit is contained in:
parent
8a7245bfea
commit
8332b31fa7
@ -1,6 +1,8 @@
|
|||||||
(function () {
|
(function () {
|
||||||
var ns = $.namespace("pskl.model");
|
var ns = $.namespace("pskl.model");
|
||||||
ns.FrameSheet = function () {
|
ns.FrameSheet = function (width, height) {
|
||||||
|
this.width = width;
|
||||||
|
this.height = height;
|
||||||
this.frames = [];
|
this.frames = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -9,7 +11,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
ns.FrameSheet.prototype.addEmptyFrame = function () {
|
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) {
|
ns.FrameSheet.prototype.addFrame = function (frame) {
|
||||||
|
10
js/piskel.js
10
js/piskel.js
@ -50,13 +50,11 @@ $.namespace("pskl");
|
|||||||
var piskel = {
|
var piskel = {
|
||||||
|
|
||||||
init : function () {
|
init : function () {
|
||||||
var emptyFrame = pskl.model.Frame.createEmpty(framePixelWidth, framePixelHeight);
|
frameSheet = new pskl.model.FrameSheet(framePixelWidth, framePixelHeight);
|
||||||
|
frameSheet.addEmptyFrame();
|
||||||
frameSheet = new pskl.model.FrameSheet();
|
|
||||||
frameSheet.addFrame(emptyFrame);
|
|
||||||
|
|
||||||
this.drawingController = new pskl.controller.DrawingController(
|
this.drawingController = new pskl.controller.DrawingController(
|
||||||
emptyFrame,
|
frameSheet.getFrameByIndex(0),
|
||||||
$('#drawing-canvas-container')[0],
|
$('#drawing-canvas-container')[0],
|
||||||
drawingCanvasDpi
|
drawingCanvasDpi
|
||||||
);
|
);
|
||||||
@ -253,7 +251,7 @@ $.namespace("pskl");
|
|||||||
penColor,
|
penColor,
|
||||||
this.drawingController
|
this.drawingController
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: Remove that when we have the centralized redraw loop
|
// TODO: Remove that when we have the centralized redraw loop
|
||||||
this.previewsController.createPreviews();
|
this.previewsController.createPreviews();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user