You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open a Roassal Easel and paste this:
| node |
node := view node: #a.
ROFocusView new on: node view: view raw.
The node is selected somewhere at the bottom. The reason is likely to be that the canvas
has a static size, instead of adapting by default to the size of the surrounding pane
Reported by tudor@tudorgirba.com on 2012-11-24 23:21:10
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
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
Activity
seandenigris commentedon Aug 3, 2015
Reported by
tudor@tudorgirba.comon 2012-11-24 23:25:55seandenigris commentedon Aug 3, 2015
Reported by
alexandre.bergelon 2012-11-25 14:14:22Startedseandenigris commentedon Aug 3, 2015
Reported by
tudor@tudorgirba.comon 2012-11-25 19:13:06seandenigris commentedon Aug 3, 2015
Reported by
alexandre.bergelon 2012-11-26 01:15:08seandenigris commentedon Aug 3, 2015
Reported by
tudor@tudorgirba.comon 2012-11-26 06:57:22seandenigris commentedon Aug 3, 2015
Reported by
benjamin.t.comanon 2012-11-26 13:45:42seandenigris commentedon Aug 3, 2015
Reported by
alexandre.bergelon 2012-11-26 14:57:00seandenigris commentedon Aug 3, 2015
Reported by
tudor@tudorgirba.comon 2013-06-03 21:13:46Fixed