[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-bug: [Bug 700841] Re: gschem: during selection invisible attributes extend component bounding box
On Monday 10 January 2011 21:40:21 you wrote:
> I agree, the patch might be a bit heavy-handed. It seems that the way to
> go is to call o_bounds_invalidate on the parent object (and do this
> recursively for sake of completeness) in the setter of visibility field.
> However this does not cover all cases - the o_bounds_invalidate() calls
> are also needed in o_complex_promote_attribs() and
> o_complex_remove_promotable_attribs().
Hi Krzysztof,
We should never invalidate bounds "just in case". That approach leads to
heisenbugs, where one code path behaves correctly but a similar one doesn't,
and thence to "cargo cult" coding. ;-)
The idea of the bounds cache, as I understand it, is that it "should" get
automagically invalidated when a property of the object involved is modified,
in the function that makes the direct change to the contents of the object's
structure. A complex object doesn't actually have bounds of its own -- its
bounds need to be invalidated whenever one of the objects it contains changes,
or when objects are added to or removed it.
This actually suggests a possible bug in o_bounds_invalidate(), in that it
should probably check if the object it's invalidating is in a complex object
(via its OBJECT.parent field -- oh look, another thing we should have an
accessor for), and if so, update the complex object's bounds too.
Let's try some subtlety, and see if we can quash this bug cleanly *and*
prevent similar bugs from cropping up elsewhere in the codebase.
That's my Â0.02. Peter C's the one who put the current bounds calculation
code in place. He's probably got a better idea than me of the best approach
to fix this.
Peter
--
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:
New
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