r5727 - trunk/eda/fped
werner at docs.openmoko.org
werner at docs.openmoko.org
Tue Dec 1 02:04:32 CET 2009
Author: werner
Date: 2009-12-01 02:04:32 +0100 (Tue, 01 Dec 2009)
New Revision: 5727
Modified:
trunk/eda/fped/gui_tool.c
trunk/eda/fped/postscript.c
Log:
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)
Modified: trunk/eda/fped/gui_tool.c
===================================================================
--- trunk/eda/fped/gui_tool.c 2009-11-30 20:13:27 UTC (rev 5726)
+++ trunk/eda/fped/gui_tool.c 2009-12-01 01:04:32 UTC (rev 5727)
@@ -443,6 +443,7 @@
obj->u.pad.other = inst_get_vec(to);
obj->u.pad.name = stralloc("?");
obj->u.pad.rounded = 1;
+ obj->u.pad.type = pt_normal;
return 1;
}
Modified: trunk/eda/fped/postscript.c
===================================================================
--- trunk/eda/fped/postscript.c 2009-11-30 20:13:27 UTC (rev 5726)
+++ trunk/eda/fped/postscript.c 2009-12-01 01:04:32 UTC (rev 5727)
@@ -998,6 +998,7 @@
}
+#if 1
int postscript(FILE *file)
{
struct pkg *pkg;
@@ -1016,3 +1017,28 @@
fflush(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
More information about the commitlog
mailing list