From 5120a9dfc6273df0bb200add77f91a68529a2847 Mon Sep 17 00:00:00 2001 From: James Crook Date: Sat, 14 Apr 2018 15:44:56 +0100 Subject: [PATCH] Fine tune spacing between minor ticks in rulers. The main point of this is not to ask for overcrowded rulers. We already handle overcrowded rulers well, by not showing the minor ticks. This change means that we are more likely to ask for a spacing that works. In turn that means that we are less likely to have anomalies where numbers disappear due to overcrowding and reappear again as you resize the ruler. --- src/widgets/Ruler.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index 7e95e7a57..a778be0ae 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -397,9 +397,11 @@ void Ruler::FindLinearTickSizes(double UPP) double d; - // As a heuristic, we want at least 16 pixels - // between each minor tick - double units = 16 * fabs(UPP); + // As a heuristic, we want at least 22 pixels between each + // minor tick. We want to show numbers like "-48" + // in that space. + // If vertical, we don't need as much space. + double units = ((mOrientation == wxHORIZONTAL) ? 22 : 12) * fabs(UPP); mDigits = 0;