Skip to content

Commit

Permalink
Merge pull request #6 from yeoji/revert-5-fix/4/multi-select-shift
Browse files Browse the repository at this point in the history
Revert "Fix broken multi select when new image is reloaded"
  • Loading branch information
yeoji authored Feb 6, 2024
2 parents a24518e + baeb05d commit 0bf8933
Show file tree
Hide file tree
Showing 5 changed files with 5,435 additions and 8,020 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ node_modules
dist
.cache
.DS_Store
.yarn
1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
},
"dependencies": {
"jquery": "^3.6.0",
"jszip": "^3.10.1",
"node-gyp": "^10.0.1"
"jszip": "^3.10.1"
}
}
17 changes: 6 additions & 11 deletions src/spritecow/SpriteCanvasView.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,19 @@ var SelectArea = (function() {
this._$eventArea = $eventArea;
this._highlight = highlight;
this._listeners = [];

this.createListeners();
}

var SelectAreaProto = SelectArea.prototype = new MicroEvent;

SelectAreaProto.createListeners = function() {
SelectAreaProto.activate = function() {
var selectArea = this,
rect = new Rect(0, 0, 0, 0),
startX, startY,
startPositionX, startPositionY,
isDragging,
$document = $(document);



selectArea._listeners.push([
selectArea._$eventArea, 'mousedown', function(event) {
if (event.button !== 0) { return; }
Expand Down Expand Up @@ -197,10 +196,6 @@ var SelectArea = (function() {
selectArea._highlight.hide();
}
]);
}

SelectAreaProto.activate = function() {
var selectArea = this;

selectArea._listeners.forEach(function(set) {
set[0].bind.apply( set[0], set.slice(1) );
Expand Down Expand Up @@ -249,7 +244,8 @@ class SpriteCanvasView {
spriteRect = spriteCanvas.expandToSpriteBoundry(rect);

spriteCanvasView._handleSelectedSprite(clickedRect, spriteRect);
} else {
}
else {
spriteCanvasView._unselectAllSprites();
}
});
Expand Down Expand Up @@ -293,7 +289,6 @@ SpriteCanvasViewProto._selectSprite = function(clickedRect, spriteRect) {

SpriteCanvasViewProto._unselectAllSprites = function() {
this._selectedSprites.forEach(sprite => sprite.unselect());
this._selectedSprites = [];
}

SpriteCanvasViewProto.setTool = function(mode) {
Expand Down
Loading

0 comments on commit 0bf8933

Please sign in to comment.