mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:48:56 +02:00
Fix edit toolbar moving to top left of screen
This commit is contained in:
parent
9ee49c3e1e
commit
f6815c215a
1 changed files with 5 additions and 2 deletions
|
@ -362,8 +362,11 @@ ToolBar = function(x, y, direction, optionalPersistenceKey, optionalInitialPosit
|
||||||
this.fractionKey = optionalPersistenceKey + '.fraction';
|
this.fractionKey = optionalPersistenceKey + '.fraction';
|
||||||
this.save = function () {
|
this.save = function () {
|
||||||
var screenSize = Controller.getViewportDimensions();
|
var screenSize = Controller.getViewportDimensions();
|
||||||
var fraction = {x: that.x / screenSize.x, y: that.y / screenSize.y};
|
if (screenSize.x > 0 && screenSize.y > 0) {
|
||||||
Settings.setValue(this.fractionKey, JSON.stringify(fraction));
|
// Guard against invalid screen size that can occur at shut-down.
|
||||||
|
var fraction = {x: that.x / screenSize.x, y: that.y / screenSize.y};
|
||||||
|
Settings.setValue(this.fractionKey, JSON.stringify(fraction));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.save = function () { }; // Called on move. Can be overriden or extended by clients.
|
this.save = function () { }; // Called on move. Can be overriden or extended by clients.
|
||||||
|
|
Loading…
Reference in a new issue