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

gEDA-cvs: pcb.git: branch: master updated (8c891cdff4a410934a3aa60f99b377d4b0ebcf77)



The branch, master has been updated
       via  8c891cdff4a410934a3aa60f99b377d4b0ebcf77 (commit)
      from  4e241279907be0bc3d7753fb6d499b8551a13cda (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 +
 1 files changed, 1 insertions(+), 0 deletions(-)


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

commit 8c891cdff4a410934a3aa60f99b377d4b0ebcf77
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Clip polygons after moving between buffers
    
    When moving a polygon between buffers (i.e., from the undo buffer
    to the PCB->Data buffer or vice-versa), line- and via-clipping is
    not recalculated. This means that any elements drawn on a buffer
    before the polygon is moved there, will not clip the polygon.
    
    One way (the only way, AFAIK) to make this happen is by bug
    lp-699272, which can reproduced as follows. I have inclided my
    explanation of what is happening at each step.
    
      1. Draw a polygon with a line intersecting it, with clearpoly
         set and visible clearance between the two.a
    
      2. Delete the polygon. [This moves the polygon verbatim, including
         its clipped form, from PCB->Data to RemoveList, the undo buffer.]
    
      3. Delete the line. [This moves it from PCB->Data to RemoveList,
         calling RestoreToPolygon() to unclip any polygons on the screen
         (but there aren't any!), then ClearFromPolygon() to clip the
         polygon in the undo buffer (but this is already clipped!). In
         other words, the line is deleted and the polygon unchanged.]
    
      4. Hit undo. [This moves the line from the undo buffer back to
         PCB->Data, calling RestoreToPolygon() to unclip the polygon in
         the undo buffer, then ClearFromPolygon() to clip any polygons on
         the screen (but there aren't any!). So the polygon is no longer
         clipped.]
    
      5. Hit undo. [This brings the polygon back, copying it verbatim from
         the undo buffer to PCB->Data. As it is not clipped here, it isn't
         clipped on the screen, giving rise to the "no clipping" bug.]
    
    This patch adds a call to InitClip() to MovePolygonToBuffer(), which
    forces a recalculation of a polygon's clipping when it is moved between
    buffers. This is perhaps not the most efficient fix, but will prevent
    any such synchronization bugs.
    
    Closes-bug: lp-699272

:100644 100644 ac2aa54... 38f0a3f... M	src/buffer.c

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

commit 8c891cdff4a410934a3aa60f99b377d4b0ebcf77
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Clip polygons after moving between buffers
    
    When moving a polygon between buffers (i.e., from the undo buffer
    to the PCB->Data buffer or vice-versa), line- and via-clipping is
    not recalculated. This means that any elements drawn on a buffer
    before the polygon is moved there, will not clip the polygon.
    
    One way (the only way, AFAIK) to make this happen is by bug
    lp-699272, which can reproduced as follows. I have inclided my
    explanation of what is happening at each step.
    
      1. Draw a polygon with a line intersecting it, with clearpoly
         set and visible clearance between the two.a
    
      2. Delete the polygon. [This moves the polygon verbatim, including
         its clipped form, from PCB->Data to RemoveList, the undo buffer.]
    
      3. Delete the line. [This moves it from PCB->Data to RemoveList,
         calling RestoreToPolygon() to unclip any polygons on the screen
         (but there aren't any!), then ClearFromPolygon() to clip the
         polygon in the undo buffer (but this is already clipped!). In
         other words, the line is deleted and the polygon unchanged.]
    
      4. Hit undo. [This moves the line from the undo buffer back to
         PCB->Data, calling RestoreToPolygon() to unclip the polygon in
         the undo buffer, then ClearFromPolygon() to clip any polygons on
         the screen (but there aren't any!). So the polygon is no longer
         clipped.]
    
      5. Hit undo. [This brings the polygon back, copying it verbatim from
         the undo buffer to PCB->Data. As it is not clipped here, it isn't
         clipped on the screen, giving rise to the "no clipping" bug.]
    
    This patch adds a call to InitClip() to MovePolygonToBuffer(), which
    forces a recalculation of a polygon's clipping when it is moved between
    buffers. This is perhaps not the most efficient fix, but will prevent
    any such synchronization bugs.
    
    Closes-bug: lp-699272

diff --git a/src/buffer.c b/src/buffer.c
index ac2aa54..38f0a3f 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -378,6 +378,7 @@ 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);
 }
 




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