1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-05 12:36:16 +02:00

Creation of a rounded pad could crash fped.

- gui_tool.c (end_new_rpad): didn't initialize obj->u.pad.type, which could
  cause pad_type_to_layers to abort
- postscript.c: added experimental code for full-page printing (doesn't work
  properly yet)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5727 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner 2009-12-01 01:04:32 +00:00
parent a26b79041b
commit 56371f440a
2 changed files with 27 additions and 0 deletions

View File

@ -443,6 +443,7 @@ static int end_new_rpad(struct inst *from, struct inst *to)
obj->u.pad.other = inst_get_vec(to); obj->u.pad.other = inst_get_vec(to);
obj->u.pad.name = stralloc("?"); obj->u.pad.name = stralloc("?");
obj->u.pad.rounded = 1; obj->u.pad.rounded = 1;
obj->u.pad.type = pt_normal;
return 1; return 1;
} }

View File

@ -998,6 +998,7 @@ static void epilogue(FILE *file)
} }
#if 1
int postscript(FILE *file) int postscript(FILE *file)
{ {
struct pkg *pkg; struct pkg *pkg;
@ -1016,3 +1017,28 @@ int postscript(FILE *file)
fflush(file); fflush(file);
return !ferror(file); return !ferror(file);
} }
#else
/*
* Experimental. Doesn't work properly.
*/
int postscript(FILE *file)
{
unit_type cx, cy;
struct bbox bbox;
double f = 0.2;
prologue(file, 1);
ps_page(file, 1, pkgs);
active_params = postscript_params;
bbox = inst_get_bbox();
cx = (bbox.min.x+bbox.max.x)/2;
cy = (bbox.min.y+bbox.max.y)/2;
fprintf(file, "%d %d translate\n", (int) (-cx*f), (int) (-cy*f));
ps_draw_package(file, pkgs->next, f);
fprintf(file, "showpage\n");
epilogue(file);
fflush(file);
return !ferror(file);
}
#endif