mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-10 19:16:20 +00:00
stop reverting to el.height for offsets if it is bigger than parent.height.
This commit is contained in:
parent
94426dfd79
commit
6357b4dfff
@ -624,7 +624,7 @@ Element.prototype.__defineGetter__('left', function() {
|
||||
if (typeof left === 'string') {
|
||||
if (left === 'center') left = '50%';
|
||||
left = +left.slice(0, -1) / 100;
|
||||
left = Math.max(this.width, this.parent.width) * left | 0;
|
||||
left = this.parent.width * left | 0;
|
||||
if (this.position.left === 'center') {
|
||||
left -= this.width / 2 | 0;
|
||||
}
|
||||
@ -650,7 +650,7 @@ Element.prototype.__defineGetter__('top', function() {
|
||||
if (typeof top === 'string') {
|
||||
if (top === 'center') top = '50%';
|
||||
top = +top.slice(0, -1) / 100;
|
||||
top = Math.max(this.height, this.parent.height) * top | 0;
|
||||
top = this.parent.height * top | 0;
|
||||
if (this.position.top === 'center') {
|
||||
top -= this.height / 2 | 0;
|
||||
}
|
||||
@ -718,7 +718,7 @@ Element.prototype.__defineGetter__('rleft', function() {
|
||||
if (typeof left === 'string') {
|
||||
if (left === 'center') left = '50%';
|
||||
left = +left.slice(0, -1) / 100;
|
||||
left = Math.max(this.width, this.parent.width) * left | 0;
|
||||
left = this.parent.width * left | 0;
|
||||
if (this.position.left === 'center') {
|
||||
left -= this.width / 2 | 0;
|
||||
}
|
||||
@ -744,7 +744,7 @@ Element.prototype.__defineGetter__('rtop', function() {
|
||||
if (typeof top === 'string') {
|
||||
if (top === 'center') top = '50%';
|
||||
top = +top.slice(0, -1) / 100;
|
||||
top = Math.max(this.height, this.parent.height) * top | 0;
|
||||
top = this.parent.height * top | 0;
|
||||
if (this.position.top === 'center') {
|
||||
top -= this.height / 2 | 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user