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

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-130-g30b150c)



The branch, master has been updated
       via  30b150c00aa04b05dd6e85cd5f336f379b4def1b (commit)
      from  2874ca6c016115363ab9edb7809d5ca66509ca14 (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
=========

 gschem/include/prototype.h |    1 +
 gschem/src/i_callbacks.c   |   17 +++++++++++------
 gschem/src/o_basic.c       |   10 +++++++---
 gschem/src/o_grips.c       |   31 +++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+), 9 deletions(-)


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

commit 30b150c00aa04b05dd6e85cd5f336f379b4def1b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Jan 3 23:54:05 2009 +0000

    gschem: Fix redrawing of other selected objects during rubberbanding
    
    Rather than switching off redrawing of selected objects during a grip
    rubberbanding operation, set the "dont_redraw" property of the object
    being modied.
    
    Add a cancel function o_grips_cancel() to reset that property in the
    case where grip modification is prematurely terminated.

:100644 100644 061a33f... 49915fd... M	gschem/include/prototype.h
:100644 100644 da043ee... a79ea53... M	gschem/src/i_callbacks.c
:100644 100644 d5bb316... 4c23f38... M	gschem/src/o_basic.c
:100644 100644 fb69ffb... 8ae6fe6... M	gschem/src/o_grips.c

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

commit 30b150c00aa04b05dd6e85cd5f336f379b4def1b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Jan 3 23:54:05 2009 +0000

    gschem: Fix redrawing of other selected objects during rubberbanding
    
    Rather than switching off redrawing of selected objects during a grip
    rubberbanding operation, set the "dont_redraw" property of the object
    being modied.
    
    Add a cancel function o_grips_cancel() to reset that property in the
    case where grip modification is prematurely terminated.

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 061a33f..49915fd 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -575,6 +575,7 @@ void o_grips_start_circle(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x,
 void o_grips_start_line(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int whichone);
 void o_grips_motion(GSCHEM_TOPLEVEL *w_current, int x, int y);
 void o_grips_end(GSCHEM_TOPLEVEL *w_current);
+void o_grips_cancel(GSCHEM_TOPLEVEL *w_current);
 void o_grips_end_arc(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone);
 void o_grips_end_box(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone);
 void o_grips_end_path(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone);
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index da043ee..a79ea53 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -3556,12 +3556,17 @@ DEFINE_I_CALLBACK(cancel)
     g_object_set_property (G_OBJECT(w_current->cswindow), "hidden", &value);
   }
 
-  /* If we're cancelling from a move action, re-wind the
-   * page contents back to their state before we started */
-  if (w_current->inside_action &&
-      (w_current->event_state == MOVE ||
-       w_current->event_state == ENDMOVE)) {
-    o_move_cancel (w_current);
+  if (w_current->inside_action) {
+    /* If we're cancelling from a move action, re-wind the
+     * page contents back to their state before we started */
+    if (w_current->event_state == MOVE ||
+        w_current->event_state == ENDMOVE)
+      o_move_cancel (w_current);
+
+    /* If we're cancelling from a grip action, call the specific cancel
+     * routine to reset the visibility of the object being modified */
+    if (w_current->event_state == GRIPS)
+      o_grips_cancel (w_current);
   }
 
   /* Free the place list and its contents. If we were in a move
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index d5bb316..4c23f38 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -41,7 +41,7 @@ void o_redraw_rects (GSCHEM_TOPLEVEL *w_current,
                      GdkRectangle *rectangles, int n_rectangles)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
-  gboolean draw_selected = TRUE;
+  gboolean draw_selected;
   int redraw_state = toplevel->DONT_REDRAW;
   int grip_half_size;
   int cue_half_size;
@@ -87,8 +87,7 @@ void o_redraw_rects (GSCHEM_TOPLEVEL *w_current,
 
   draw_selected = !(w_current->inside_action &&
                     ((w_current->event_state == MOVE) ||
-                     (w_current->event_state == ENDMOVE) ||
-                     (w_current->event_state == GRIPS)));
+                     (w_current->event_state == ENDMOVE)));
 
   w_current->inside_redraw = 1;
   for (iter = obj_list; iter != NULL; iter = g_list_next (iter)) {
@@ -359,6 +358,11 @@ int o_redraw_cleanstates(GSCHEM_TOPLEVEL *w_current)
         o_move_cancel (w_current);
       }
 
+      /* If we're cancelling from a grip action, call the specific cancel
+       * routine to reset the visibility of the object being modified */
+      if (w_current->event_state == GRIPS)
+        o_grips_cancel (w_current);
+
       /* Free the place list and its contents. If we were in a move
        * action, the list (refering to objects on the page) would
        * already have been cleared in o_move_cancel(), so this is OK. */
diff --git a/gschem/src/o_grips.c b/gschem/src/o_grips.c
index fb69ffb..8ae6fe6 100644
--- a/gschem/src/o_grips.c
+++ b/gschem/src/o_grips.c
@@ -561,6 +561,9 @@ int o_grips_start(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
   w_current->which_grip = whichone;
   w_current->which_object = object;
 
+  /* Switch off drawing for the object being modified */
+  object->dont_redraw = TRUE;
+
   /* there is one */
   /* depending on its type, start the modification process */
   switch(object->type) {
@@ -1026,6 +1029,9 @@ void o_grips_end(GSCHEM_TOPLEVEL *w_current)
     return;
   }
 
+  /* Switch drawing of the object back on */
+  object->dont_redraw = FALSE;
+
   switch(object->type) {
 
     case(OBJ_ARC):
@@ -1087,6 +1093,31 @@ void o_grips_end(GSCHEM_TOPLEVEL *w_current)
   o_undo_savestate(w_current, UNDO_ALL);
 }
 
+
+/*! \brief Cancel process of modifying object with grip.
+ *
+ *  \par Function Description
+ *  This function cancels the process of modifying a parameter
+ *  of an object with a grip. It's main utility is to reset the
+ *  dont_redraw flag on the object which was being modified.
+ *
+ *  \param [in,out] w_current  The GSCHEM_TOPLEVEL object.
+ */
+void o_grips_cancel(GSCHEM_TOPLEVEL *w_current)
+{
+  OBJECT *object = w_current->which_object;
+
+  /* reset global variables */
+  w_current->which_grip = -1;
+  w_current->which_object = NULL;
+  w_current->rubber_visible = 0;
+
+  /* Switch drawing of the object back on */
+  g_return_if_fail (object != NULL);
+  object->dont_redraw = FALSE;
+}
+
+
 /*! \brief End process of modifying arc object with grip.
  *  \par Function Description
  *  This function ends the grips process specific to an arc object. It erases




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