So here's a something I can't figure out
while trying to pick a transformed path's bounds ....
agg::rect_i bounds_rect = glyph->bounds;
bounds_rect.normalize();
double x1, x2, y1, y2;
x1 = bounds_rect.x1;
y1 = bounds_rect.y1 + _offsetY;
x2 = bounds_rect.x2;
y2 = bounds_rect.y2 + _offsetY;
matrix.transform(&x1,&y1);
matrix.transform(&x2,&y2);
double minx = min(x1,x2);
double miny = min(y1,y2);
double maxx = max(x1,x2);
double maxy = max(y1,y2);
The
above produces different mins and maxs on the y axis:
typedef
conv_transform<path_storage, trans_affine>
pathTransform;
double x1, x2, y1, y2, sx, sy;
agg::rect_i bounds_rect = glyph->bounds;
bounds_rect.normalize();
agg::path_storage bounds_path;
bounds_path.move_to( bounds_rect.x1, bounds_rect.y1
+ _offsetY );
bounds_path.line_to( bounds_rect.x1, bounds_rect.y2
+ _offsetY );
bounds_path.line_to( bounds_rect.x2, bounds_rect.y2
+ _offsetY );
bounds_path.line_to( bounds_rect.x2, bounds_rect.y1
+ _offsetY );
bounds_path.close_polygon();
pathTransform transpath( bounds_path, matrix );
transpath.rewind(0);
unsigned subcmd = transpath.vertex(&sx,&sy);
minx=sx;
maxx=sx;
miny=sy;
maxy=sy;
while (!agg::is_close(subcmd))
{
minx = min(minx,sx);
maxx = max(maxx,sx);
miny = min(miny,sy);
maxy = max(maxy,sy);
subcmd = transpath.vertex(&sx,&sy);
}
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial.
http://p.sf.net/sfu/www-adobe-com_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general