mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-02 16:01:55 +02:00
* Fix some handling of height, itemSpacing, etc. in VerticalMenuView
* Change auto scale to be height/width dependent
This commit is contained in:
parent
7fc4858959
commit
37adeb5f90
4 changed files with 19 additions and 44 deletions
16
core/view.js
16
core/view.js
|
@ -55,11 +55,15 @@ function View(options) {
|
|||
this.setPosition(options.position);
|
||||
}
|
||||
|
||||
this.autoScale = _.isBoolean(options.autoScale) ? options.autoScale : true;
|
||||
if(_.isObject(options.autoScale)) {
|
||||
this.autoScale = options.autoScale;
|
||||
} else {
|
||||
this.autoScale = { height : true, width : true };
|
||||
}
|
||||
|
||||
if(options.dimens) {
|
||||
this.setDimension(options.dimens);
|
||||
this.autoScale = false; // no auto scaling dimens supplied
|
||||
this.autoScale = { height : false, width : false };
|
||||
} else {
|
||||
this.dimens = { width : 0, height : 0 };
|
||||
}
|
||||
|
@ -137,15 +141,17 @@ View.prototype.setDimension = function(dimens) {
|
|||
assert(_.isObject(dimens) && _.isNumber(dimens.height) && _.isNumber(dimens.width));
|
||||
|
||||
this.dimens = dimens;
|
||||
this.autoScale = false;
|
||||
this.autoScale = { height : false, width : false };
|
||||
};
|
||||
|
||||
View.prototype.setHeight = function(height) {
|
||||
this.setDimension( { height : height, width : this.dimens.width } );
|
||||
this.dimens.height = height;
|
||||
this.autoScale.height = false;
|
||||
};
|
||||
|
||||
View.prototype.setWidth = function(width) {
|
||||
this.setDimension( { height : this.dimens.height, width : width } );
|
||||
this.dimens.width = width;
|
||||
this.autoScale.width = false;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue