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

gEDA-cvs: pcb.git: branch: master updated (4a303a4ae56b38cd6dd1f602dffa0c7af3f15a02)



The branch, master has been updated
       via  4a303a4ae56b38cd6dd1f602dffa0c7af3f15a02 (commit)
       via  a3da8e96096109c4a28f562a8c8f891b7915f0ba (commit)
       via  aba41a7ee2f2c0ace082998d5e6c0f2cbff84147 (commit)
      from  8c891cdff4a410934a3aa60f99b377d4b0ebcf77 (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
=========

 src/buffer.c  |    1 -
 src/create.c  |    1 +
 src/global.h  |    1 +
 src/move.c    |   17 +++++++++++------
 src/polygon.c |    6 ++++++
 src/set.c     |    8 ++++++++
 6 files changed, 27 insertions(+), 7 deletions(-)


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

commit 4a303a4ae56b38cd6dd1f602dffa0c7af3f15a02
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Properly cancel rubberband move when user changes mode
    
    Closes-bug: lp-853609

:100644 100644 7c637c1... 18fffa7... M	src/set.c

commit a3da8e96096109c4a28f562a8c8f891b7915f0ba
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Update line RUBBERENDFLAG after move, even for trivial moves
    
    If you move a line segment, then drop it in its original place,
    the rubberband preview will be incorrect every other time you
    do this. This patch fixes that.
    
    Note that there is still incorrect behavior if the user starts
    a rubberband move, then hits Esc, then tries again.
    
    Affects-bug: lp-853609

:100644 100644 6b6359a... 56ced53... M	src/move.c

commit aba41a7ee2f2c0ace082998d5e6c0f2cbff84147
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Revert previous commit, only update clipping for visible buffers
    
    This also fixes the undo bug, but without the performance hit.
    (It may not fix other synchronization bugs, but given that we
    haven't seen any, this should be okay.)
    
    Affects-bug: lp-699272

:100644 100644 38f0a3f... ac2aa54... M	src/buffer.c
:100644 100644 a199acc... 8d8344c... M	src/create.c
:100644 100644 9f0390b... 8896901... M	src/global.h
:100644 100644 14f239d... 1114e33... M	src/polygon.c

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

commit 4a303a4ae56b38cd6dd1f602dffa0c7af3f15a02
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Properly cancel rubberband move when user changes mode
    
    Closes-bug: lp-853609

diff --git a/src/set.c b/src/set.c
index 7c637c1..18fffa7 100644
--- a/src/set.c
+++ b/src/set.c
@@ -53,6 +53,7 @@
 #include "error.h"
 #include "find.h"
 #include "misc.h"
+#include "move.h"
 #include "set.h"
 #include "undo.h"
 #include "pcb-printf.h"
@@ -288,6 +289,13 @@ SetMode (int Mode)
       Settings.Mode = Mode;
       AdjustAttachedObjects ();
     }
+  /* Cancel rubberband move */
+  else if (Settings.Mode == MOVE_MODE)
+    MoveObjectAndRubberband (Crosshair.AttachedObject.Type,
+                             Crosshair.AttachedObject.Ptr1,
+                             Crosshair.AttachedObject.Ptr2,
+                             Crosshair.AttachedObject.Ptr3,
+                             0, 0);
   else
     {
       if (Settings.Mode == ARC_MODE || Settings.Mode == LINE_MODE)

commit a3da8e96096109c4a28f562a8c8f891b7915f0ba
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Update line RUBBERENDFLAG after move, even for trivial moves
    
    If you move a line segment, then drop it in its original place,
    the rubberband preview will be incorrect every other time you
    do this. This patch fixes that.
    
    Note that there is still incorrect behavior if the user starts
    a rubberband move, then hits Esc, then tries again.
    
    Affects-bug: lp-853609

diff --git a/src/move.c b/src/move.c
index 6b6359a..56ced53 100644
--- a/src/move.c
+++ b/src/move.c
@@ -800,8 +800,6 @@ MoveObjectAndRubberband (int Type, void *Ptr1, void *Ptr2, void *Ptr3,
   /* setup offset */
   DeltaX = DX;
   DeltaY = DY;
-  if (DX == 0 && DY == 0)
-    return (NULL);
 
   /* move all the lines... and reset the counter */
   ptr = Crosshair.AttachedObject.Rubberband;
@@ -809,14 +807,21 @@ MoveObjectAndRubberband (int Type, void *Ptr1, void *Ptr2, void *Ptr3,
     {
       /* first clear any marks that we made in the line flags */
       CLEAR_FLAG (RUBBERENDFLAG, ptr->Line);
-      AddObjectToMoveUndoList (LINEPOINT_TYPE,
-			       ptr->Layer, ptr->Line, ptr->MovedPoint, DX,
-			       DY);
-      MoveLinePoint (ptr->Layer, ptr->Line, ptr->MovedPoint);
+      /* only update undo list if an actual movement happened */
+      if (DX != 0 || DY != 0)
+        {
+          AddObjectToMoveUndoList (LINEPOINT_TYPE,
+                                   ptr->Layer, ptr->Line,
+                                   ptr->MovedPoint, DX, DY);
+          MoveLinePoint (ptr->Layer, ptr->Line, ptr->MovedPoint);
+        }
       Crosshair.AttachedObject.RubberbandN--;
       ptr++;
     }
 
+  if (DX == 0 && DY == 0)
+    return (NULL);
+
   AddObjectToMoveUndoList (Type, Ptr1, Ptr2, Ptr3, DX, DY);
   ptr2 = ObjectOperation (&MoveFunctions, Type, Ptr1, Ptr2, Ptr3);
   IncrementUndoSerialNumber ();

commit aba41a7ee2f2c0ace082998d5e6c0f2cbff84147
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Revert previous commit, only update clipping for visible buffers
    
    This also fixes the undo bug, but without the performance hit.
    (It may not fix other synchronization bugs, but given that we
    haven't seen any, this should be okay.)
    
    Affects-bug: lp-699272

diff --git a/src/buffer.c b/src/buffer.c
index 38f0a3f..ac2aa54 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -378,7 +378,6 @@ MovePolygonToBuffer (LayerType *layer, PolygonType *polygon)
   if (!lay->polygon_tree)
     lay->polygon_tree = r_create_tree (NULL, 0, 0);
   r_insert_entry (lay->polygon_tree, (BoxType *)polygon, 0);
-  InitClip (Dest, lay, polygon);
   return (polygon);
 }
 
diff --git a/src/create.c b/src/create.c
index a199acc..8d8344c 100644
--- a/src/create.c
+++ b/src/create.c
@@ -152,6 +152,7 @@ CreateNewPCB (bool SetDefaultNames)
   ptr = (PCBTypePtr)calloc (1, sizeof (PCBType));
   ptr->Data = CreateNewBuffer ();
   ptr->Data->pcb = (PCBTypePtr) ptr;
+  ptr->Data->polyClip = 1;
 
   ptr->ThermStyle = 4;
   ptr->IsleArea = 2.e8;
diff --git a/src/global.h b/src/global.h
index 9f0390b..8896901 100644
--- a/src/global.h
+++ b/src/global.h
@@ -404,6 +404,7 @@ typedef struct			/* holds all objects */
    *rat_tree;
   struct PCBType *pcb;
   LayerType Layer[MAX_LAYER + 2];	/* add 2 silkscreen layers */
+  int polyClip;
 } DataType, *DataTypePtr;
 
 typedef struct			/* holds drill information */
diff --git a/src/polygon.c b/src/polygon.c
index 14f239d..1114e33 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -1626,6 +1626,9 @@ PlowsPolygon (DataType * Data, int type, void *ptr1, void *ptr2,
 void
 RestoreToPolygon (DataType * Data, int type, void *ptr1, void *ptr2)
 {
+  if (!Data->polyClip)
+    return;
+
   if (type == POLYGON_TYPE)
     InitClip (PCB->Data, (LayerTypePtr) ptr1, (PolygonTypePtr) ptr2);
   else
@@ -1635,6 +1638,9 @@ RestoreToPolygon (DataType * Data, int type, void *ptr1, void *ptr2)
 void
 ClearFromPolygon (DataType * Data, int type, void *ptr1, void *ptr2)
 {
+  if (!Data->polyClip)
+    return;
+
   if (type == POLYGON_TYPE)
     InitClip (PCB->Data, (LayerTypePtr) ptr1, (PolygonTypePtr) ptr2);
   else




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