mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 09:33:29 +02:00
Added removeLastTool() to toolBar.js
This commit is contained in:
parent
9b5b83117f
commit
872ec21822
1 changed files with 18 additions and 2 deletions
|
@ -127,7 +127,7 @@ Tool.IMAGE_HEIGHT = 50;
|
|||
Tool.IMAGE_WIDTH = 50;
|
||||
|
||||
ToolBar = function(x, y, direction) {
|
||||
this.tools = [];
|
||||
this.tools = new Array();
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = 0;
|
||||
|
@ -161,9 +161,25 @@ ToolBar = function(x, y, direction) {
|
|||
});
|
||||
}
|
||||
|
||||
this.tools[this.tools.length] = new Tool(properties, selectable, selected);
|
||||
this.tools.push(new Tool(properties, selectable, selected));
|
||||
return ((this.tools.length) - 1);
|
||||
}
|
||||
|
||||
this.removeLastTool = function() {
|
||||
this.tools.pop().cleanup();
|
||||
|
||||
if (direction == ToolBar.HORIZONTAL) {
|
||||
this.width -= Tool.IMAGE_WIDTH + ToolBar.SPACING;
|
||||
} else {
|
||||
this.height -= Tool.IMAGE_HEIGHT + ToolBar.SPACING;
|
||||
}
|
||||
if (this.back != null) {
|
||||
Overlays.editOverlay(this.back, {
|
||||
width: this.width + 2 * ToolBar.SPACING,
|
||||
height: this.height + 2 * ToolBar.SPACING
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
this.move = function(x, y) {
|
||||
var dx = x - this.x;
|
||||
|
|
Loading…
Reference in a new issue