Skip to content

ROFocusView focuses on the wrong spot #870

Closed

Description

@seandenigris

Originally reported on Google Code with ID 870

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

Activity

  1. seandenigris commented on Aug 3, 2015

    @seandenigris
    ContributorAuthor

    Reported by tudor@tudorgirba.com on 2012-11-24 23:25:55

  2. seandenigris commented on Aug 3, 2015

    @seandenigris
    ContributorAuthor
    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

    • Status changed: Started
  3. seandenigris commented on Aug 3, 2015

    @seandenigris
    ContributorAuthor
    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

  4. seandenigris commented on Aug 3, 2015

    @seandenigris
    ContributorAuthor
    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

  5. seandenigris commented on Aug 3, 2015

    @seandenigris
    ContributorAuthor
    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

  6. seandenigris commented on Aug 3, 2015

    @seandenigris
    ContributorAuthor
    > 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

  7. seandenigris commented on Aug 3, 2015

    @seandenigris
    ContributorAuthor
    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

  8. seandenigris commented on Aug 3, 2015

    @seandenigris
    ContributorAuthor
    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

    • Status changed: Fixed
    • Labels added: Milestone-4.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions