mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-03 08:22:02 +02:00
* Fix key press event for EditTextView
* Fix MCI draw issue for TextView * Missing bbs.js MCI init
This commit is contained in:
parent
30ba609fb4
commit
383b3b449d
3 changed files with 19 additions and 13 deletions
|
@ -119,14 +119,17 @@ function TextView(options) {
|
|||
}
|
||||
}
|
||||
|
||||
this.client.term.write(padStr(
|
||||
textToDraw,
|
||||
this.dimens.width + 1,
|
||||
this.fillChar,
|
||||
this.justify,
|
||||
this.hasFocus ? this.getFocusSGR() : this.getSGR(),
|
||||
this.getStyleSGR(1) || this.getSGR()
|
||||
), false);
|
||||
this.client.term.write(
|
||||
padStr(
|
||||
textToDraw,
|
||||
this.dimens.width + 1,
|
||||
this.fillChar,
|
||||
this.justify,
|
||||
this.hasFocus ? this.getFocusSGR() : this.getSGR(),
|
||||
this.getStyleSGR(1) || this.getSGR()
|
||||
),
|
||||
false // no converting CRLF needed
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
@ -184,7 +187,7 @@ TextView.prototype.setText = function(text, redraw) {
|
|||
|
||||
var widthDelta = 0;
|
||||
if(this.text && this.text !== text) {
|
||||
widthDelta = Math.abs(this.text.length - text.length);
|
||||
widthDelta = Math.abs(renderStringLength(this.text) - renderStringLength(text));
|
||||
}
|
||||
|
||||
this.text = text;
|
||||
|
@ -198,7 +201,7 @@ TextView.prototype.setText = function(text, redraw) {
|
|||
this.text = stylizeString(this.text, this.hasFocus ? this.focusTextStyle : this.textStyle);
|
||||
|
||||
if(this.autoScale.width) {
|
||||
this.dimens.width = this.text.length + widthDelta;
|
||||
this.dimens.width = renderStringLength(this.text) + widthDelta;
|
||||
}
|
||||
|
||||
if(redraw) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue