Closed seandenigris closed 9 years ago
Reported by tudor@tudorgirba.com
on 2012-11-24 23:25:55
This is not an easy problem to solve apparently.
Try the following:
-=-=-=-=-= -=-=-=-=-= -=-=-=-=-= -=-=-=-=-=
| node |
node := view node: #a.
view raw
on: ROWindowResized
do: [ :evt | ROFocusView new on: node view: view raw ].
-=-=-=-=-= -=-=-=-=-= -=-=-=-=-= -=-=-=-=-=
This seems to do the thing, but if you resize the window, the view always focuses on
the node.
If you do not want to focus on the node when you resize, we could do:
-=-=-=-=-= -=-=-=-=-= -=-=-=-=-= -=-=-=-=-=
| node |
node := view node: #a.
view raw
on: ROWindowResized
doOnce: [ :evt | ROFocusView new on: node view: view raw ].
-=-=-=-=-= -=-=-=-=-= -=-=-=-=-= -=-=-=-=-=
But this does not work since the romorph is resized 4 times when you open the roassal
glamour-based easel.
Reported by alexandre.bergel
on 2012-11-25 14:14:22
Started
The problem is not that the view does not keep being focused. The problem is that the
focused element is placed at a strange location: the node appears somewhere at the
bottom left.
I would expect a different behavior. Perhaps something like:
- if the element is already visible, nothing should be done
- if the element is not visible, the camera should move with the minimal amount until
the node gets in the camera
Reported by tudor@tudorgirba.com
on 2012-11-25 19:13:06
I am not sure to understand. In the moose one-click, if I open a glamour-based roassal
easel, and type:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| node |
node := view node: #a.
view raw
on: ROWindowResized
do: [ :evt | ROFocusView new on: node view: view raw ].
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The node is at the center of the roassal widget. Is this not the case for you?
What do you mean by "The problem is not that the view does not keep being focused."?
The node remains at the center of the roassal pane if I resize the easel.
Reported by alexandre.bergel
on 2012-11-26 01:15:08
Indeed, this was the case. Now it works.
However, we still need to enhance the logic a bit, or add a different action that has
a different semantics.
For example, in a tree layout, you never want it in the middle:
| node |
node := view node: 'a'.
view node: 'b'.
view edge: 42 from: ['a'] to: ['b'].
view treeLayout.
view raw
on: ROWindowResized
do: [ :evt | ROFocusView new on: node view: view raw ].
Reported by tudor@tudorgirba.com
on 2012-11-26 06:57:22
> But this does not work since the romorph is resized 4 times when you open the roassal
glamour-based easel.
That currently has no visible effect, and so suits me fine for the moment.
Reported by benjamin.t.coman
on 2012-11-26 13:45:42
Doru, I do not understand "in a tree layout, you never want it in the middle".
What we do not want it in the middle? The tree? Why not?
A semantic could be: if the visualization is smaller than the window, then do nothing
when focusing?
Reported by alexandre.bergel
on 2012-11-26 14:57:00
Ok. Now it seems to work well:
| node |
node := view node: -1.
view nodes: (1 to: 1000).
view edgesFrom: [ :x | x // 10 ].
view treeLayout.
ROFocusView new on: node view: view raw.
Reported by tudor@tudorgirba.com
on 2013-06-03 21:13:46
Fixed
Originally reported on Google Code with ID 870
Reported by
tudor@tudorgirba.com
on 2012-11-24 23:21:10