Skip to content

Commit 32da891

Browse files
committed
GRASS shell cursor shift fix better
1 parent 00a9a7d commit 32da891

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/plugins/grass/qtermwidget/TerminalDisplay.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -200,23 +200,23 @@ void TerminalDisplay::setVTFont( const QFont& f )
200200

201201
QFontMetrics metrics( font );
202202

203-
if ( metrics.height() < height() && metrics.maxWidth() < width() )
204-
{
205-
// hint that text should be drawn without anti-aliasing.
206-
// depending on the user's font configuration, this may not be respected
207-
if ( !_antialiasText )
208-
font.setStyleStrategy( QFont::NoAntialias );
209-
210-
// experimental optimization. Konsole assumes that the terminal is using a
211-
// mono-spaced font, in which case kerning information should have an effect.
212-
// Disabling kerning saves some computation when rendering text.
213-
font.setKerning( false );
214-
}
203+
// The condition checking if font is smaller than widget was causing #7340 (cursor shift)
204+
// probably because this was called before the widget was rendered and got its size
205+
//if ( metrics.height() < height() && metrics.maxWidth() < width() )
206+
//{
207+
// hint that text should be drawn without anti-aliasing.
208+
// depending on the user's font configuration, this may not be respected
209+
if ( !_antialiasText )
210+
font.setStyleStrategy( QFont::NoAntialias );
211+
212+
// experimental optimization. Konsole assumes that the terminal is using a
213+
// mono-spaced font, in which case kerning information should have an effect.
214+
// Disabling kerning saves some computation when rendering text.
215+
font.setKerning( false );
215216

216-
// This was in the block above so that font was not properly set if called
217-
// before the widget was rendered and got its size and it was causing #7340 (cursor shift)
218217
QWidget::setFont( font );
219218
fontChange( font );
219+
//}
220220
}
221221

222222
void TerminalDisplay::setFont( const QFont & )

0 commit comments

Comments
 (0)