From 5ecffaed1b9b648c52ddd99d8c879f6ab1280575 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Thu, 6 Aug 2009 09:53:17 +0200 Subject: [PATCH] fixed text selection with --flatten --- lib/devices/polyops.c | 5 ++--- lib/gfxtools.c | 2 +- lib/gfxtools.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/devices/polyops.c b/lib/devices/polyops.c index 9893d1d..70fd99b 100644 --- a/lib/devices/polyops.c +++ b/lib/devices/polyops.c @@ -315,9 +315,8 @@ void polyops_drawchar(struct _gfxdevice*dev, gfxfont_t*font, int glyphnr, gfxcol gfxbbox_t bbox2 = gfxline_getbbox(gfxline); 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) > DEFAULT_GRID*2 || - fabs((bbox.ymax - bbox.ymin) - h) > DEFAULT_GRID*2) { + 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? */ diff --git a/lib/gfxtools.c b/lib/gfxtools.c index 9143507..239ba6f 100644 --- a/lib/gfxtools.c +++ b/lib/gfxtools.c @@ -831,7 +831,7 @@ void gfxfontlist_free(gfxfontlist_t*list, char deletefonts) } } -gfxline_t*gfxline_makerectangle(int x1,int y1,int x2, int y2) +gfxline_t*gfxline_makerectangle(double x1,double y1,double x2, double y2) { gfxline_t* line = (gfxline_t*)rfx_calloc(sizeof(gfxline_t)*5); line[0].x = x1;line[0].y = y1;line[0].type = gfx_moveTo;line[0].next = &line[1]; diff --git a/lib/gfxtools.h b/lib/gfxtools.h index a49a9b5..c2566d3 100644 --- a/lib/gfxtools.h +++ b/lib/gfxtools.h @@ -87,7 +87,7 @@ void gfxfontlist_free(gfxfontlist_t*list, char deletefonts); gfxbbox_t* gfxline_isrectangle(gfxline_t*_l); -gfxline_t*gfxline_makerectangle(int x1, int y1, int x2, int y2); +gfxline_t*gfxline_makerectangle(double x1, double y1, double x2, double y2); gfxline_t*gfxline_makecircle(double x,double y,double rx, double ry); void gfxline_show(gfxline_t*line, FILE*fi); -- 1.7.10.4