[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-185-gbb074bd)



The branch, master has been updated
       via  bb074bdd2a30fd3b941be2683c905a99d330243a (commit)
      from  28ee7866d44c74927401d362aceec4474bb5075c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 libgeda/src/f_print.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)


=================
 Commit Messages
=================

commit bb074bdd2a30fd3b941be2683c905a99d330243a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Jan 17 22:48:41 2009 +0000

    libgeda: Fix printing of colours.
    
    To avoid emitting a colour change for each object printed, libgeda caches
    the last colour it wrote into a postscript file, and doesn't emit a new
    colour change command when the next object is the same colour.
    
    Drawing of complex and text objects are wrapped by a "gsave" and "grestore"
    pair, which resets the postscript interpreter's current colour, so we need
    to restore our variable tracking the last drawn colour after these groups.
    
    Fixes mis-drawn colours noted by DJ on the geda-user list.

:100644 100644 883da82... a4befd6... M	libgeda/src/f_print.c

=========
 Changes
=========

commit bb074bdd2a30fd3b941be2683c905a99d330243a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Jan 17 22:48:41 2009 +0000

    libgeda: Fix printing of colours.
    
    To avoid emitting a colour change for each object printed, libgeda caches
    the last colour it wrote into a postscript file, and doesn't emit a new
    colour change command when the next object is the same colour.
    
    Drawing of complex and text objects are wrapped by a "gsave" and "grestore"
    pair, which resets the postscript interpreter's current colour, so we need
    to restore our variable tracking the last drawn colour after these groups.
    
    Fixes mis-drawn colours noted by DJ on the geda-user list.

diff --git a/libgeda/src/f_print.c b/libgeda/src/f_print.c
index 883da82..a4befd6 100644
--- a/libgeda/src/f_print.c
+++ b/libgeda/src/f_print.c
@@ -231,6 +231,7 @@ void f_print_objects (TOPLEVEL *toplevel, FILE *fp, const GList *obj_list,
 {
   OBJECT *o_current=NULL;
   int origin_x, origin_y;
+  int save_last_ps_color;
   const GList *iter;
 	
   origin_x = start_x;
@@ -284,6 +285,7 @@ void f_print_objects (TOPLEVEL *toplevel, FILE *fp, const GList *obj_list,
 
       case(OBJ_COMPLEX):
       case(OBJ_PLACEHOLDER): /* new object -- 1.20.2005 SDB */
+        save_last_ps_color = toplevel->last_ps_color;
         fprintf(fp, "gsave\n");
 
         f_print_objects(toplevel, fp,
@@ -291,6 +293,7 @@ void f_print_objects (TOPLEVEL *toplevel, FILE *fp, const GList *obj_list,
                         origin_x, origin_y, scale,
                         unicode_count, unicode_table);
         fprintf(fp, "grestore\n");
+        toplevel->last_ps_color = save_last_ps_color;
         break;
 
       case(OBJ_TEXT):
@@ -308,6 +311,7 @@ void f_print_objects (TOPLEVEL *toplevel, FILE *fp, const GList *obj_list,
             vectors = 1;
           }
 
+          save_last_ps_color = toplevel->last_ps_color;
           fprintf(fp, "gsave\n");
 
           if (vectors)
@@ -327,6 +331,7 @@ void f_print_objects (TOPLEVEL *toplevel, FILE *fp, const GList *obj_list,
           }
 
           fprintf(fp, "grestore\n");
+          toplevel->last_ps_color = save_last_ps_color;
         }
         break;
 




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs