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

gEDA-bug: [Bug 700841] Re: gschem: during selection invisible attributes extend component bounding box



Third patch: Fixing the problem ;)

This is not quite right either:

+  /* If at least one attribute was promoted */
+  if (g_list_first (promoted) != NULL) {
+      o_bounds_invalidate (toplevel, object);
+  }
+

Firstly, as a stylistic nit "promoted" IS the head of the list, so
"promoted != NULL" would suffice. Peter Brett also rightly pointed out
that for any arbitrary point in the GList, g_list_first (point) != NULL
implies point != NULL.

You invalidate at the bottom of the function, but in reality it only
needs to be done for the else clause of the if if
(toplevel->keep_invisible) {} statement.

e.g:

  } else {
    for (iter = promotable; iter != NULL; iter = g_list_next (iter)) {
      OBJECT *o_removed = (OBJECT *) iter->data;
      o_removed->parent = NULL;
      object->complex->prim_objs =
        g_list_remove (object->complex->prim_objs, o_removed);
    }
    promoted = promotable;
   /* Invalidate the object's bounds since we may have stolen objects from inside it */
   o_bounds_invalidate (toplevel, object); 
  }

(Note the comment for clarity)

I've dropped the if (promoted != NULL), as I think it is harmless to
invalidate anyway. If you fancied, you could add a quick return to the
function after getting the promotable attribute list:

  promotable = o_complex_get_promotable (toplevel, object, FALSE);
  if (promotable == NULL)
     return NULL;

-- 
You received this bug notification because you are a member of gEDA Bug
Team, which is subscribed to gEDA.
https://bugs.launchpad.net/bugs/700841

Title:
  gschem: during selection invisible attributes extend component bounding box 

Status in GPL Electronic Design Automation tools:
  In Progress

Bug description:
  Intermittently gschem gets into a state when promotable (visible) attributes within a component extend component's bounding box used for selection calculations.
In such cases component might not be selected even if selection rectangle encloses component's graphics and pins.
It is also possible to select the component by clicking on an empy space far away from it - because in the symbol file a visible attribute is located at that offset.

It is expected that components can be always selected by drawing a selection rectangle that encloses all graphical elements and pins.

When the bug occurs, toggling "show/hide invisible text" restores correct behavior.




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