diff options
| author | Neil <nyamatongwe@gmail.com> | 2021-09-28 12:53:58 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2021-09-28 12:53:58 +1000 | 
| commit | fe41a24534e1280f088835ea1813fa64120f4169 (patch) | |
| tree | b25f80573180e44d01b078331022251792174f86 /src/ViewStyle.cxx | |
| parent | 810964f8e6b80fbfdb7f96b9a084acc4cbe5a3a1 (diff) | |
| download | scintilla-mirror-fe41a24534e1280f088835ea1813fa64120f4169.tar.gz | |
Fix bad layout of monospace text on Cocoa by adding separate field
monospaceCharacterWidth for width of monospaced characters.
Diffstat (limited to 'src/ViewStyle.cxx')
| -rw-r--r-- | src/ViewStyle.cxx | 2 | 
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 84d165997..5273841ed 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -66,6 +66,7 @@ void FontRealised::Realise(Surface &surface, int zoomLevel, Technology technolog  	measurements.capitalHeight = surface.Ascent(font.get()) - surface.InternalLeading(font.get());  	measurements.aveCharWidth = surface.AverageCharWidth(font.get()); +	measurements.monospaceCharacterWidth = measurements.aveCharWidth;  	measurements.spaceWidth = surface.WidthText(font.get(), " ");  	if (fs.checkMonospaced) { @@ -82,6 +83,7 @@ void FontRealised::Realise(Surface &surface, int zoomLevel, Technology technolog  		const XYPOSITION scaledVariance = variance / measurements.aveCharWidth;  		constexpr XYPOSITION monospaceWidthEpsilon = 0.000001;	// May need tweaking if monospace fonts vary more  		measurements.monospaceASCII = scaledVariance < monospaceWidthEpsilon; +		measurements.monospaceCharacterWidth = minWidth;  	} else {  		measurements.monospaceASCII = false;  	}  | 
