From 68cc54216d78decf60bd6ccd36355bdddf30d833 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 11 Mar 2015 13:37:11 +1100 Subject: Allow minimum tab width to be tweaked to allow character cell implementation to work better. --- src/EditView.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/EditView.cxx') diff --git a/src/EditView.cxx b/src/EditView.cxx index 9d940f701..5372e3abd 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -173,6 +173,7 @@ const XYPOSITION epsilon = 0.0001f; // A small nudge to avoid floating point pre EditView::EditView() { ldTabstops = NULL; + tabWidthMinimumPixels = 2; // needed for calculating tab stops for fractional proportional fonts hideSelection = false; drawOverstrikeCaret = true; bufferedDraw = true; @@ -220,10 +221,10 @@ void EditView::ClearAllTabstops() { } XYPOSITION EditView::NextTabstopPos(int line, XYPOSITION x, XYPOSITION tabWidth) const { - int next = GetNextTabstop(line, static_cast(x + 2)); + int next = GetNextTabstop(line, static_cast(x + tabWidthMinimumPixels)); if (next > 0) return static_cast(next); - return (static_cast((x + 2) / tabWidth) + 1) * tabWidth; + return (static_cast((x + tabWidthMinimumPixels) / tabWidth) + 1) * tabWidth; } bool EditView::ClearTabstops(int line) { -- cgit v1.2.3