mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Basic cut implementation
SelectionManager implmentaiton Rectangular seleciton impl Utils refacoring Event manager refactoring basic cut implmentation
This commit is contained in:
22
js/piskel.js
22
js/piskel.js
@@ -34,7 +34,7 @@ $.namespace("pskl");
|
||||
|
||||
frameSheet = new pskl.model.FrameSheet(framePixelWidth, framePixelHeight);
|
||||
frameSheet.addEmptyFrame();
|
||||
|
||||
|
||||
this.drawingController = new pskl.controller.DrawingController(
|
||||
frameSheet,
|
||||
$('#drawing-canvas-container'),
|
||||
@@ -54,12 +54,28 @@ $.namespace("pskl");
|
||||
previewTileCanvasDpi
|
||||
);
|
||||
|
||||
// To catch the current active frame, the selection manager have to be before
|
||||
// the 'frameSheet.setCurrentFrameIndex(0);'
|
||||
// TODO(vincz): Slice each constructor to have:
|
||||
// - an event(s) listening init
|
||||
// - an event(s) triggering init
|
||||
// All listerners will be hook in a first step, then all event triggering inits will be called
|
||||
// in a second batch.
|
||||
this.selectionManager =
|
||||
new pskl.selection.SelectionManager(this.drawingController.overlayFrame);
|
||||
|
||||
frameSheet.setCurrentFrameIndex(0);
|
||||
|
||||
|
||||
|
||||
this.animationController.init();
|
||||
this.previewsController.init();
|
||||
|
||||
this.historyManager = new pskl.HistoryManager(frameSheet);
|
||||
this.historyManager.init();
|
||||
|
||||
this.keyManager = new pskl.KeyManager();
|
||||
|
||||
pskl.NotificationService.init();
|
||||
pskl.LocalStorageService.init(frameSheet);
|
||||
|
||||
@@ -73,10 +89,6 @@ $.namespace("pskl");
|
||||
pskl.LocalStorageService.displayRestoreNotification();
|
||||
}
|
||||
|
||||
$.subscribe('SET_ACTIVE_FRAME', function(evt, frameId) {
|
||||
frameSheet.setCurrentFrameIndex(frameId);
|
||||
});
|
||||
|
||||
var drawingLoop = new pskl.rendering.DrawingLoop();
|
||||
drawingLoop.addCallback(this.render, this);
|
||||
drawingLoop.start();
|
||||
|
||||
Reference in New Issue
Block a user