From 277db7db94ce70f1642b7ad16d138f114c76310b Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Fri, 8 Jun 2012 08:23:34 -0700 Subject: Move measure angle string to keep it visible when angle is small. (bzr r11469) --- src/measure-context.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/measure-context.cpp') diff --git a/src/measure-context.cpp b/src/measure-context.cpp index 33650d8dd..a3ff816c3 100644 --- a/src/measure-context.cpp +++ b/src/measure-context.cpp @@ -181,6 +181,12 @@ Geom::Point calcAngleDisplayAnchor(SPDesktop *desktop, double angle, double base Geom::Point where(lengthVal, 0); where *= Geom::Affine(Geom::Rotate(effective)) * Geom::Affine(Geom::Translate(startPoint)); + // When the angle is tight, the label would end up under the cursor and/or lines. Bump it + double scaledFontsize = std::abs(fontsize * desktop->w2d(Geom::Point(0, 1.0))[Geom::Y]); + if (std::abs((where - endPoint).length()) < scaledFontsize) { + where[Geom::Y] += scaledFontsize * 2; + } + // We now have the ideal position, but need to see if it will fit/work. Geom::Rect visibleArea = desktop->get_display_area(); -- cgit v1.2.3