Skip to content

Commit

Permalink
Calculate exact bounding boxes for GlyphSymbolizer.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.mapnik.org/trunk@2146 d397654b-2ff0-0310-9e29-ba003691a0f9
  • Loading branch information
herm committed Aug 13, 2010
1 parent 9a0bb39 commit ad1943c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/agg/process_glyph_symbolizer.cpp
Expand Up @@ -76,10 +76,7 @@ void agg_renderer<T>::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<double> dim = ren.prepare_glyphs(path.get());
double bsize = (dim.width()>dim.height()?dim.width():dim.height())/2;
box2d<double> ext(
floor(x-bsize), floor(y-bsize), ceil(x+bsize), ceil(y+bsize)
);
box2d<double> 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)))
{
Expand Down

0 comments on commit ad1943c

Please sign in to comment.