From b6f839b0f1624c8628b69293bd06cce7a9acb439 Mon Sep 17 00:00:00 2001 From: Hermann Kraus Date: Fri, 13 Aug 2010 00:51:58 +0000 Subject: [PATCH] Calculate exact bounding boxes for GlyphSymbolizer. --- src/agg/process_glyph_symbolizer.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/agg/process_glyph_symbolizer.cpp b/src/agg/process_glyph_symbolizer.cpp index c8d97ce1a..e3b31b3cb 100644 --- a/src/agg/process_glyph_symbolizer.cpp +++ b/src/agg/process_glyph_symbolizer.cpp @@ -76,10 +76,7 @@ void agg_renderer::process(glyph_symbolizer const& sym, // Prepare glyphs to set internal state and calculate the marker's // final box so we can check for a valid placement box2d dim = ren.prepare_glyphs(path.get()); - double bsize = (dim.width()>dim.height()?dim.width():dim.height())/2; - box2d ext( - floor(x-bsize), floor(y-bsize), ceil(x+bsize), ceil(y+bsize) - ); + box2d ext(x-dim.width()/2, y-dim.height()/2, x+dim.width()/2, y+dim.height()/2); if ((sym.get_allow_overlap() || detector_.has_placement(ext)) && (!sym.get_avoid_edges() || detector_.extent().contains(ext))) {