1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-09-29 23:40:46 +00:00

Render terminal cursor in a less awkward way

The previous way seemed weird enough to seem to have had a purpose, but I can't tell. Revert this if it turns out that there was.
This commit is contained in:
Lignum 2017-05-04 23:53:43 +02:00
parent 7e71045c7b
commit 4e3def39e0
No known key found for this signature in database
GPG Key ID: E4DE8F54CA0912BA

View File

@ -407,23 +407,22 @@ public class WidgetTerminal extends Widget
TextBuffer colour = terminal.getTextColourLine( line ); TextBuffer colour = terminal.getTextColourLine( line );
TextBuffer backgroundColour = terminal.getBackgroundColourLine( line ); TextBuffer backgroundColour = terminal.getBackgroundColourLine( line );
fontRenderer.drawString( text, x, y, colour, backgroundColour, m_leftMargin, m_rightMargin, greyscale ); fontRenderer.drawString( text, x, y, colour, backgroundColour, m_leftMargin, m_rightMargin, greyscale );
if( tblink && ty == line ) y += FixedWidthFontRenderer.FONT_HEIGHT;
{ }
if( tx >= 0 && tx < tw )
{ if( tblink )
TextBuffer cursor = new TextBuffer( '_', 1 ); {
TextBuffer cursorColour = new TextBuffer( "0123456789abcdef".charAt( terminal.getTextColour() ), 1 ); TextBuffer cursor = new TextBuffer( '_', 1 );
fontRenderer.drawString( TextBuffer cursorColour = new TextBuffer( "0123456789abcdef".charAt( terminal.getTextColour() ), 1 );
cursor,
x + FixedWidthFontRenderer.FONT_WIDTH * tx, fontRenderer.drawString(
y, cursor,
cursorColour, null, x + FixedWidthFontRenderer.FONT_WIDTH * tx,
0, 0, startY + m_topMargin + FixedWidthFontRenderer.FONT_HEIGHT * ty,
greyscale cursorColour, null,
); 0, 0,
} greyscale
} );
y = y + FixedWidthFontRenderer.FONT_HEIGHT;
} }
} }
} }