mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-24 18:13:15 -05:00
Fix hud not resizing properly, fix chat moving down when input bar was closed.
This commit is contained in:
parent
403f313ed9
commit
a3807afd53
2 changed files with 5 additions and 3 deletions
|
@ -17,6 +17,8 @@ namespace ClassicalSharp {
|
|||
this.font = font;
|
||||
this.boldFont = boldFont;
|
||||
chatInputText = new WrappableStringBuffer( len );
|
||||
DrawTextArgs args = new DrawTextArgs( "_", boldFont, false );
|
||||
defaultHeight = game.Drawer2D.MeasureChatSize( ref args ).Height;
|
||||
}
|
||||
|
||||
Texture chatInputTexture, caretTexture;
|
||||
|
@ -46,8 +48,7 @@ namespace ClassicalSharp {
|
|||
game.Drawer2D.MakeBitmappedTextTexture( ref args, 0, 0 ) :
|
||||
game.Drawer2D.MakeTextTexture( ref args, 0, 0 );
|
||||
chatInputText.WordWrap( ref parts, ref partLens, 64 );
|
||||
defaultHeight = game.Drawer2D.MeasureChatSize( ref args ).Height;
|
||||
|
||||
|
||||
maxWidth = 0;
|
||||
args = new DrawTextArgs( null, font, false );
|
||||
for( int i = 0; i < lines; i++ ) {
|
||||
|
@ -158,7 +159,7 @@ namespace ClassicalSharp {
|
|||
chatInputText.Clear();
|
||||
caretPos = -1;
|
||||
Dispose();
|
||||
Height = 0;
|
||||
Height = defaultHeight;
|
||||
}
|
||||
|
||||
void SendInBuffer() {
|
||||
|
|
|
@ -317,6 +317,7 @@ namespace ClassicalSharp {
|
|||
if( activeScreen != null ) {
|
||||
activeScreen.OnResize( width, height, Width, Height );
|
||||
}
|
||||
hudScreen.OnResize( width, height, Width, Height );
|
||||
width = Width;
|
||||
height = Height;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue