moose-technology@googlecode.com wrote:
Updates: Status: Fixed
Comment #14 on issue 842 by alexandr...@gmail.com: ROTranslatingShape mouse hotspot mis-alignment http://code.google.com/p/moose-technology/issues/detail?id=842
Hi!
Thanks for your post. It was inspiring. I spent a lot of time on think about the implication about having a translating shape and an offset. Neither approach has convinced me so far.
The reason is the following: shapes are closely dependent from each other, meaning that the element is the only entity subject to layout, looking up subnodes, and responsible for its bounds. This model is quite simple, easy to understand, easy to debug. Adding a concept of offset breaks this nice small model. As soon as you want shapes to be next to each other, you need a kind of layout, at least to say that shape1 is on the left-hand side of shape2. However, layouts work only on elements.
I came to the conclusion to not have translation or offset for shape. The source code has been reverted to the equivalent of what it was a couple of weeks ago. This is not I am against this idea, however I could not find a clean and appealing way to implement it without redesigning the shapes hierarchy. Subclassing ROElement should easily solve your problem although.
I consider this issue as fixed so far.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Upon further consideration of doing this at the Element level, not sure if this is a bug or just my understanding. One of the things I liked about using shapes to offset labels is that ROLightlyHighlightable highlighted both the element and the label when I hovered over either. Referring to example below, if I add ROLightlyHighlightable to 'inner' or 'innerLabel' then nothing at all happens when I hover over either. However if I add ROLightlyHighlightable to 'outer' - the blue square displays only around the outside of the 'outer' element, and no change to the 'inner' and 'innerLabel'. -------------------------------- | view outter inner innerLabel | view := ROView new.
outter := ROElement new + ROBorder white. outter @ RODraggable @ ROLightlyHighlightable .
inner := ROElement sprite . innerLabel := ROElement labelOn: 'My sprite'. outter add: inner; add: innerLabel.
inner forward. innerLabel forward.
"We layout the things" ROVerticalLineLayout on: outter elements.
view add: outter. view open