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:
33dd61b
)
the zero bounding box correction linewidth is now configurable.
author
kramm
<kramm>
Tue, 24 Aug 2004 15:51:52 +0000
(15:51 +0000)
committer
kramm
<kramm>
Tue, 24 Aug 2004 15:51:52 +0000
(15:51 +0000)
pdf2swf/swfoutput.cc
patch
|
blob
|
history
diff --git
a/pdf2swf/swfoutput.cc
b/pdf2swf/swfoutput.cc
index
189f3ec
..
9d7930f
100644
(file)
--- a/
pdf2swf/swfoutput.cc
+++ b/
pdf2swf/swfoutput.cc
@@
-48,6
+48,7
@@
int flashversion=5;
int splinemaxerror=1;
int fontsplinemaxerror=1;
int filloverlap=0;
int splinemaxerror=1;
int fontsplinemaxerror=1;
int filloverlap=0;
+float minlinewidth=0.1;
static char storefont = 0;
static int flag_protected = 0;
static char storefont = 0;
static int flag_protected = 0;
@@
-774,7
+775,7
@@
static inline int colorcompare(RGBA*a,RGBA*b)
static const int CHARDATAMAX = 8192;
struct chardata {
int charid;
static const int CHARDATAMAX = 8192;
struct chardata {
int charid;
- int fontid;
+ int fontid; /* TODO: use a SWFFONT instead */
int x;
int y;
int size;
int x;
int y;
int size;
@@
-1457,7
+1458,9
@@
void fixAreas()
{
if(!shapeisempty && fill &&
(bboxrect.xmin == bboxrect.xmax ||
{
if(!shapeisempty && fill &&
(bboxrect.xmin == bboxrect.xmax ||
- bboxrect.ymin == bboxrect.ymax)) {
+ bboxrect.ymin == bboxrect.ymax) &&
+ minlinewidth >= 0.001
+ ) {
msg("<debug> Shape has size 0");
if(bboxrect.xmin == bboxrect.xmax && bboxrect.ymin == bboxrect.ymax) {
msg("<debug> Shape has size 0");
if(bboxrect.xmin == bboxrect.xmax && bboxrect.ymin == bboxrect.ymax) {
@@
-1467,16
+1470,16
@@
void fixAreas()
float x=0,y=0;
if(bboxrect.xmin == bboxrect.xmax) {
float x=0,y=0;
if(bboxrect.xmin == bboxrect.xmax) {
- x = 0.05;
+ x = minlinewidth;
} else {
} else {
- y = 0.05;
+ y = minlinewidth;
}
/* warning: doing this inside endshape() is dangerous */
}
/* warning: doing this inside endshape() is dangerous */
- moveto(tag, bboxrect.xmin/20.0, bboxrect.ymin/20.0);
+ moveto(tag, bboxrect.xmin/20.0 , bboxrect.ymin/20.0);
lineto(tag, bboxrect.xmax/20.0 + x, bboxrect.ymin/20.0);
lineto(tag, bboxrect.xmax/20.0 + x, bboxrect.ymax/20.0 + y);
lineto(tag, bboxrect.xmax/20.0 + x, bboxrect.ymin/20.0);
lineto(tag, bboxrect.xmax/20.0 + x, bboxrect.ymax/20.0 + y);
- lineto(tag, bboxrect.xmin/20.0, bboxrect.ymax/20.0 + y);
- lineto(tag, bboxrect.xmin/20.0, bboxrect.ymin/20.0);
+ lineto(tag, bboxrect.xmin/20.0 , bboxrect.ymax/20.0 + y);
+ lineto(tag, bboxrect.xmin/20.0 , bboxrect.ymin/20.0);
}
}
}
}
@@
-2159,6
+2162,8
@@
void swfoutput_setparameter(char*name, char*value)
insertstoptag = atoi(value);
} else if(!strcmp(name, "flashversion")) {
flashversion = atoi(value);
insertstoptag = atoi(value);
} else if(!strcmp(name, "flashversion")) {
flashversion = atoi(value);
+ } else if(!strcmp(name, "minlinewidth")) {
+ minlinewidth = atof(value);
} else if(!strcmp(name, "jpegquality")) {
int val = atoi(value);
if(val<0) val=0;
} else if(!strcmp(name, "jpegquality")) {
int val = atoi(value);
if(val<0) val=0;