From 045202e3f24b49de267ae49160d09a43cb251af3 Mon Sep 17 00:00:00 2001 From: Will Charczuk Date: Mon, 11 Jul 2016 11:03:07 -0700 Subject: [PATCH] adding stroke to annotation measure. --- drawing_helpers.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drawing_helpers.go b/drawing_helpers.go index f692741..f7e5dd5 100644 --- a/drawing_helpers.go +++ b/drawing_helpers.go @@ -59,8 +59,10 @@ func MeasureAnnotation(r Renderer, canvasBox Box, xrange, yrange Range, s Style, pr := s.Padding.GetRight(DefaultAnnotationPadding.Right) pb := s.Padding.GetBottom(DefaultAnnotationPadding.Bottom) + strokeWidth := s.GetStrokeWidth() + top := ly - (pt + halfTextHeight) - right := lx + pl + pr + textWidth + DefaultAnnotationDeltaWidth + right := lx + pl + pr + textWidth + DefaultAnnotationDeltaWidth + int(strokeWidth) bottom := ly + (pb + halfTextHeight) return Box{ @@ -103,7 +105,7 @@ func DrawAnnotation(r Renderer, canvasBox Box, xrange, yrange Range, s Style, lx //draw the shape... r.SetFillColor(s.GetFillColor(DefaultAnnotationFillColor)) r.SetStrokeColor(s.GetStrokeColor()) - r.SetStrokeWidth(s.GetStrokeWidth()) + r.SetStrokeWidth(strokeWidth) r.MoveTo(lx, ly) r.LineTo(ltx, lty)