Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#375 closed defect (fixed)

Cannot scroll canvas display out of range

Reported by: westram Owned by: devel
Priority: normal Milestone:
Component: global Version: gtkport
Keywords: Cc:

Description

Motif version allowed to scroll the display into "empty range" outside the actually drawn graphics using the middle mouse button. gtk version denies doing that.

Problems occurring by gtk behavior:

  1. In the radial tree, text is not completely inside the scrollable area.
  2. another related problem occurs in ARB_SECEDIT:
    • set the root to a loop at the outside of the structure
    • rotate the structure
    • ⇒ parts of the structure easily get unaccessible

Problem 2. is obviously caused by some missing size-announcement after the structure change (motif version does not adapt scrollbars when that happens). With motif that was acceptable, because you could use the middle mouse to scroll the display where ever you want. With gtk you can't. But I fear adding the missing size-announcement will trigger other unwanted behavior - like resetting zoom or changing scroll-position when EDIT4-cursor moves vertically through the sequences in the editor while displaying secondary structure.

If there is an simple way to allow scrolling the display outside the actually drawn area in gtk, i would prefer that way, since getting the size calculations right is always a PITA (as you've seen with EDIT4).

Change History (6)

comment:1 Changed 11 years ago by westram

  • Component changed from !NoIdea to global
  • Version set to gtkport

comment:2 follow-up: Changed 11 years ago by epruesse

1 is probably due to wrong text width calculations — does it work in motif?

When scrolling with middle mouse, AWT_canvas::scroll() is called, scrolls the window and sets the scrollbars. Before setting the scrollbars, canvas clamps those to world size. Setting them triggers a second scroll, which moves the image back.

I could disengage the scrollbar change event when the scrollbar position is changed manually, which was probably the motif behavior. Better might be to alter the worldsize appropriately, that way the scrollbars would also be rendered correctly.

comment:3 in reply to: ↑ 2 ; follow-up: Changed 11 years ago by westram

Replying to epruesse:

1 is probably due to wrong text width calculations — does it work in motif?

Text calculation is correct - it works in motif and it also works in gtk. But arb provides two modes for zooming - one taking tree-structure- and -text-size into account, the other only taking the tree-structure-size. You can toggle these modes using 'ARB_NTREE/Properties/Tree Settings/Text? zoom/pad'.

When scrolling with middle mouse, AWT_canvas::scroll() is called, scrolls the window and sets the scrollbars. Before setting the scrollbars, canvas clamps those to world size. Setting them triggers a second scroll, which moves the image back.

That's maybe the reason why it flickers.

I could disengage the scrollbar change event when the scrollbar position is changed manually,

With 'manually' you mean 'by code'?

which was probably the motif behavior. Better might be to alter the worldsize appropriately, that way the scrollbars would also be rendered correctly.

It's quite difficult to get sth like a "correct" worldsize:

  • if text is considered to be part of the world, the worldsize changes when changing the current zoom-factor
  • if text is not considered, the worldsize does not change by zooming, but then there is some text outside "the world"

Furthermore resetting the display to the worldsize also affects zooming with mouse wheel:

  • if the display shows all (unzoomed) and you move the mouse to one treepart near the border and zoom in there, the tree does not only zoom, but also moves. Motif version always keeps the treepart fixed under the mouse position (at least it tries to).
  • same applies when zooming out: the tree starts moving towards the upper-left corner. In motif version the world-location under the cursor remains the same.

comment:4 in reply to: ↑ 3 Changed 11 years ago by epruesse

When scrolling with middle mouse, AWT_canvas::scroll() is called, scrolls the window and sets the scrollbars. Before setting the scrollbars, canvas clamps those to world size. Setting them triggers a second scroll, which moves the image back.

That's maybe the reason why it flickers.

Among other things. The concept in GTK (and all others, AFAIK) is that only the draw CB actually does drawing. All the other CBs only invalidate regions, so that those can be summarized and drawing is only done once.

I could disengage the scrollbar change event when the scrollbar position is changed manually,

With 'manually' you mean 'by code'?

… changed by ARB, not from the GTK/User side.

comment:5 follow-up: Changed 11 years ago by epruesse

  • Resolution set to fixed
  • Status changed from new to closed

fixed by r10742

comment:6 in reply to: ↑ 5 Changed 11 years ago by westram

Replying to epruesse:

fixed by r10742

Great - works fine :)

Note: See TracTickets for help on using tickets.