OSDN Git Service

Fixed visible wrap column on systems with non-fractional fonts sizes
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
Mon, 22 Nov 2010 09:20:15 +0000 (10:20 +0100)
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
Mon, 22 Nov 2010 15:41:04 +0000 (16:41 +0100)
commit68266eae2e43886be7ff4a16f5575ca036e539b7
tree65be3098c17ce9c8af92377afed8e3bca9529613
parent10b0c3f445c17b3ed7652d9f7f4eded49d2e414f
Fixed visible wrap column on systems with non-fractional fonts sizes

QFontMetricsF::averageCharWidth seems to always return a fractional size
(at least on Linux/GNOME with DejaVu Mono), even when the font is not
actually drawn at sub-pixels. This caused the visible wrap column to
appear in the wrong place.

As a workaround, use the width of the character 'x', which is pretty
average and does align to pixels when needed.

Task-number: QTCREATORBUG-2746
Reviewed-by: con
src/plugins/texteditor/basetexteditor.cpp