Copy paste out of bounds : added SelectionManager unit tests

This commit is contained in:
juliandescottes
2015-08-09 15:42:46 +02:00
parent fdb5483e87
commit 99da69553c
3 changed files with 213 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
ns.BaseSelect = function() {
this.secondaryToolId = pskl.tools.drawing.Move.TOOL_ID;
this.BodyRoot = $('body');
this.bodyRoot = $('body');
// Select's first point coordinates (set in applyToolAt)
this.startCol = null;
@@ -81,12 +81,12 @@
if (overlay.containsPixel(col, row)) {
if (this.isInSelection(col, row)) {
// We're hovering the selection, show the move tool:
this.BodyRoot.addClass(this.secondaryToolId);
this.BodyRoot.removeClass(this.toolId);
this.bodyRoot.addClass(this.secondaryToolId);
this.bodyRoot.removeClass(this.toolId);
} else {
// We're not hovering the selection, show create selection tool:
this.BodyRoot.addClass(this.toolId);
this.BodyRoot.removeClass(this.secondaryToolId);
this.bodyRoot.addClass(this.toolId);
this.bodyRoot.removeClass(this.secondaryToolId);
}
}
};