mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fixed size related issues. Selection Manager no longer depends on the frameoverlay which is now only manipulated by the tools
This commit is contained in:
@@ -2,13 +2,14 @@
|
||||
var ns = $.namespace("pskl.selection");
|
||||
|
||||
|
||||
ns.SelectionManager = function (framesheet, overlayFrame) {
|
||||
ns.SelectionManager = function (framesheet) {
|
||||
|
||||
this.framesheet = framesheet;
|
||||
this.overlayFrame = overlayFrame;
|
||||
|
||||
this.currentSelection = null;
|
||||
|
||||
};
|
||||
|
||||
ns.SelectionManager.prototype.init = function () {
|
||||
$.subscribe(Events.SELECTION_CREATED, $.proxy(this.onSelectionCreated_, this));
|
||||
$.subscribe(Events.SELECTION_DISMISSED, $.proxy(this.onSelectionDismissed_, this));
|
||||
$.subscribe(Events.SELECTION_MOVE_REQUEST, $.proxy(this.onSelectionMoved_, this));
|
||||
@@ -23,11 +24,10 @@
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ns.SelectionManager.prototype.cleanSelection_ = function(selection) {
|
||||
ns.SelectionManager.prototype.cleanSelection_ = function() {
|
||||
if(this.currentSelection) {
|
||||
this.currentSelection.reset();
|
||||
}
|
||||
this.overlayFrame.clear();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -106,12 +106,7 @@
|
||||
ns.SelectionManager.prototype.onSelectionCreated_ = function(evt, selection) {
|
||||
if(selection) {
|
||||
this.currentSelection = selection;
|
||||
var pixels = selection.pixels;
|
||||
for(var i=0, l=pixels.length; i<l; i++) {
|
||||
this.overlayFrame.setPixel(pixels[i].col, pixels[i].row, Constants.SELECTION_TRANSPARENT_COLOR);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw "No selection set in SelectionManager";
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user