summaryrefslogtreecommitdiff
path: root/lib/devices
diff options
context:
space:
mode:
authorMatthias Kramm <kramm@quiss.org>2010-07-13 10:05:43 -0700
committerMatthias Kramm <kramm@quiss.org>2010-07-13 10:05:43 -0700
commit44e25c2c99223969d876d72d99a48a88463f4b8c (patch)
tree638f512ba9e362fdaa02f7285e76f6bfd03e474a /lib/devices
parent0c67088fc32e7f9564d12fde7730cd7e67eabd85 (diff)
new option remove_small_polygons
Diffstat (limited to 'lib/devices')
-rw-r--r--lib/devices/swf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/devices/swf.c b/lib/devices/swf.c
index 2cafb0e1..c833e51f 100644
--- a/lib/devices/swf.c
+++ b/lib/devices/swf.c
@@ -116,6 +116,7 @@ typedef struct _swfoutput_internal
int config_disable_polygon_conversion;
int config_normalize_polygon_positions;
int config_alignfonts;
+ double config_remove_small_polygons;
char config_disablelinks;
RGBA config_linkcolor;
float config_minlinewidth;
@@ -2108,6 +2109,8 @@ int swf_setparameter(gfxdevice_t*dev, const char*name, const char*value)
}
} else if(!strcmp(name, "minlinewidth")) {
i->config_minlinewidth = atof(value);
+ } else if(!strcmp(name, "remove_small_polygons")) {
+ i->config_remove_small_polygons = atof(value);
} else if(!strcmp(name, "caplinewidth")) {
i->config_caplinewidth = atof(value);
} else if(!strcmp(name, "linktarget")) {
@@ -2692,9 +2695,16 @@ static void swf_fill(gfxdevice_t*dev, gfxline_t*line, gfxcolor_t*color)
return;
if(!color->a)
return;
+
gfxbbox_t r = gfxline_getbbox(line);
int is_outside_page = !is_inside_page(dev, r.xmin, r.ymin) || !is_inside_page(dev, r.xmax, r.ymax);
+ if(r.xmax - r.xmin < i->config_remove_small_polygons &&
+ r.ymax - r.ymin < i->config_remove_small_polygons) {
+ msg("<verbose> Not drawing %.2fx%.2f polygon", r.xmax - r.xmin, r.ymax - r.ymin);
+ return;
+ }
+
endtext(dev);
if(!i->config_ignoredraworder)