From 7cb416041d114236b97a14a090e4764e4ae5b34a Mon Sep 17 00:00:00 2001 From: Will Charczuk Date: Sun, 10 Jul 2016 23:45:25 -0700 Subject: [PATCH] tweaks. --- drawing/raster_graphic_context.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drawing/raster_graphic_context.go b/drawing/raster_graphic_context.go index 32d6ad8..cdf894e 100644 --- a/drawing/raster_graphic_context.go +++ b/drawing/raster_graphic_context.go @@ -159,6 +159,9 @@ func (rgc *RasterGraphicContext) GetStringBounds(s string) (left, top, right, bo } rgc.recalc() + left = math.MaxFloat64 + top = math.MaxFloat64 + cursor := 0.0 prev, hasPrev := truetype.Index(0), false for _, rc := range s { @@ -191,7 +194,7 @@ func (rgc *RasterGraphicContext) GetStringBounds(s string) (left, top, right, bo // recalc recalculates scale and bounds values from the font size, screen // resolution and font metrics, and invalidates the glyph cache. func (rgc *RasterGraphicContext) recalc() { - rgc.current.Scale = rgc.current.FontSizePoints * float64(rgc.DPI) * 64.0 / 72.0 + rgc.current.Scale = rgc.current.FontSizePoints * float64(rgc.DPI) } // SetFont sets the font used to draw text.