git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dfa75b5
)
fixed character clipping test in --flatten
author
Matthias Kramm
<kramm@quiss.org>
Wed, 5 Aug 2009 21:29:53 +0000
(23:29 +0200)
committer
Matthias Kramm
<kramm@quiss.org>
Wed, 5 Aug 2009 21:29:53 +0000
(23:29 +0200)
lib/devices/polyops.c
patch
|
blob
|
history
diff --git
a/lib/devices/polyops.c
b/lib/devices/polyops.c
index
416797c
..
9893d1d
100644
(file)
--- a/
lib/devices/polyops.c
+++ b/
lib/devices/polyops.c
@@
-305,6
+305,9
@@
void polyops_drawchar(struct _gfxdevice*dev, gfxfont_t*font, int glyphnr, gfxcol
if(i->clip && i->clip->poly) {
gfxbbox_t bbox = gfxline_getbbox(glyph);
gfxpoly_t*dummybox = gfxpoly_createbox(bbox.xmin,bbox.ymin,bbox.xmax,bbox.ymax, DEFAULT_GRID);
if(i->clip && i->clip->poly) {
gfxbbox_t bbox = gfxline_getbbox(glyph);
gfxpoly_t*dummybox = gfxpoly_createbox(bbox.xmin,bbox.ymin,bbox.xmax,bbox.ymax, DEFAULT_GRID);
+ gfxline_t*dummybox2 = gfxline_from_gfxpoly(dummybox);
+ bbox = gfxline_getbbox(dummybox2);
+ gfxline_free(dummybox2);
char ok=0;
gfxline_t*gfxline = handle_poly(dev, dummybox, &ok);
char ok=0;
gfxline_t*gfxline = handle_poly(dev, dummybox, &ok);
@@
-313,8
+316,8
@@
void polyops_drawchar(struct _gfxdevice*dev, gfxfont_t*font, int glyphnr, gfxcol
double w = bbox2.xmax - bbox2.xmin;
double h = bbox2.ymax - bbox2.ymin;
if(w < 0.001 || h < 0.001) /* character was clipped completely */ {
double w = bbox2.xmax - bbox2.xmin;
double h = bbox2.ymax - bbox2.ymin;
if(w < 0.001 || h < 0.001) /* character was clipped completely */ {
- } else if(fabs((bbox.xmax - bbox.xmin) - w) > 0.05 ||
- fabs((bbox.ymax - bbox.ymin) - h) > 0.05) {
+ } else if(fabs((bbox.xmax - bbox.xmin) - w) > DEFAULT_GRID*2 ||
+ fabs((bbox.ymax - bbox.ymin) - h) > DEFAULT_GRID*2) {
/* notable change in character size: character was clipped
TODO: how to deal with diagonal cuts?
*/
/* notable change in character size: character was clipped
TODO: how to deal with diagonal cuts?
*/