Skip to content

Commit

Permalink
Console: Change when scrollY is called
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrzarzycki21 committed Feb 6, 2024
1 parent f365bbf commit 8b4f590
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Source/superhuman/components/Console.hx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class Console extends LayoutGroup implements IConsole {
#if windows
text = StringTools.replace( text, '\r\n', '\n' );
#end

_textList.appendText( text, isError );
this.dispatchEvent( new Event( Event.CHANGE ) );

Expand Down Expand Up @@ -227,12 +228,12 @@ class ConsoleTextArea extends TextArea {

}

override function update() {
/* override function update() {
super.update();
if ( _scrollToBottom ) this.scrollY = this.maxScrollY;
}
}*/

override function baseScrollContainer_addedToStageHandler(event:Event) {

Expand Down Expand Up @@ -297,7 +298,7 @@ class ConsoleTextList extends ListView {
}

public function appendText( text:String, isError:Bool = false ) {

_elements.add( { text: text, isError: isError } );

}
Expand All @@ -317,10 +318,11 @@ class ConsoleTextList extends ListView {
}

override function update() {

if ( _scrollToBottom )
{
this.scrollY = this.maxScrollY;
}
super.update();
if ( _scrollToBottom ) this.scrollY = this.maxScrollY;

}

function _allElementsRemoved( e:FlatCollectionEvent ) { }
Expand Down

0 comments on commit 8b4f590

Please sign in to comment.