Index: /trunk/Ohana/src/kapa2/include/prototypes.h
===================================================================
--- /trunk/Ohana/src/kapa2/include/prototypes.h	(revision 33649)
+++ /trunk/Ohana/src/kapa2/include/prototypes.h	(revision 33650)
@@ -99,4 +99,5 @@
 int           ListSection         PROTO((int sock));
 void          SetSectionSizes     PROTO((Section *section));
+int           SectionMinBoundary  PROTO((Graphic *graphic));
 
 KapaGraphWidget *InitGraph        PROTO((void));
Index: /trunk/Ohana/src/kapa2/src/PNGit.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/PNGit.c	(revision 33649)
+++ /trunk/Ohana/src/kapa2/src/PNGit.c	(revision 33650)
@@ -22,4 +22,7 @@
 
   graphic = GetGraphic();
+
+  // limit the png window to the min needed to contain the active graphic regions
+  SectionMinBoundary (graphic);
 
   f = fopen (filename, "w");
@@ -81,8 +84,8 @@
   /* see docs for write-row-callback to provide progress info */
   if (haveImage) {
-    png_set_IHDR (png_ptr, info_ptr, graphic->dx, graphic->dy, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+    png_set_IHDR (png_ptr, info_ptr, graphic->dxwin, graphic->dywin, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
     png_set_sRGB (png_ptr, info_ptr, PNG_sRGB_INTENT_ABSOLUTE);
   } else {
-    png_set_IHDR (png_ptr, info_ptr, graphic->dx, graphic->dy, 8, PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); 
+    png_set_IHDR (png_ptr, info_ptr, graphic->dxwin, graphic->dywin, 8, PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); 
     png_set_PLTE (png_ptr, info_ptr, palette, Npalette); 
   }
Index: /trunk/Ohana/src/kapa2/src/Sections.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/Sections.c	(revision 33649)
+++ /trunk/Ohana/src/kapa2/src/Sections.c	(revision 33650)
@@ -245,4 +245,12 @@
     int Xe = 0;
     int Ye = 0;
+
+# if (1)
+    graphic->xwin  = 0;
+    graphic->ywin  = 0;
+    graphic->dxwin = graphic->dx;
+    graphic->dywin = graphic->dy; 
+    return TRUE;
+# endif
 
     // the boundary for a single section should probably be adjusted depending on the 
Index: /trunk/Ohana/src/kapa2/src/bDrawIt.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/bDrawIt.c	(revision 33649)
+++ /trunk/Ohana/src/kapa2/src/bDrawIt.c	(revision 33650)
@@ -12,6 +12,4 @@
 
   black = KapaColorByName ("black");
-
-  // SectionMinBoundary (graphic);
 
   // if we want to trim, we'll need to carry about the start in graphic coords and
Index: /trunk/Ohana/src/libkapa/src/bDrawFuncs.c
===================================================================
--- /trunk/Ohana/src/libkapa/src/bDrawFuncs.c	(revision 33649)
+++ /trunk/Ohana/src/libkapa/src/bDrawFuncs.c	(revision 33650)
@@ -1,4 +1,3 @@
 # include <kapa_internal.h>
-# define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); abort (); } }
 
 // move these to the bDrawBuffer type
