• Have custom map with scrollarea and zoomin/out functionality.
    When zoomed in and than scrolled to corner and than zoomed out -> map is zoomed out but not positioned in corner anymore (bug in all three corners scrollarea is not aligned on)
    Noticed that small manual screen size reduction is triggering some viewer internal action and scrollarea is scrolled automatically to correct position. Is there a command to force this.
    Can read roverflow, toverflow, boverflow, woverflow, hoverflow to detect is this command is to be called. Tried with invalidatescreen(), updatescreen() with no luck.


    Anyone had similar behavior and found a way to force alignment to corner always?

  • Hereis the online version to get impression on what I'm talking about

    Use case is following:
    - when image is loaded go to + sigh and press twice
    - Map is zoomed. Scroll image with mouse (dragging) to some corner. Image will align automatically at the end in the corner.
    - Press - sigh for zoom out. Image will reduce and stay not aligned correctly.

    At this point need some tweaks to align it. Interesing is when at this moment you go maximise or change window size it align perfectly. That lead me in direction of invalidate/update screen commands. Tried with no luck.

    Do you have any idea. Have seen that behaviour on other forum collegues too. Thought this is some code mistake or Scrollarea plugin inperfection but now when I see that is image goes where it should be when window size adjusted....hm

  • Really hard nut to crack...

    Fortunately I have a zoomable map in one of my VTs, so I gave it a look.

    I added trace(); to onscroll(); and checked x and y of scrollarea. So log gave me a flow of numbers when scrollarea was scrolling. Obviously there's some algorythm we cannot solve without Klaus(( As I understand it, scrollarea tends to settle on some "x/y" point which depends on its "align" value and its ratio to the stage width and height. For sure, when scrolled, scrollarea alters its x/y coordinates, as I see it in the log. So when I click "zoom_out" button while scrollarea is still scrolling, it works fine and scrollarea sticks to the corner. However, if I let it come to a halt and then press "zoom_out", then it stays still and doesn't stick to the corner.

    I thought about adding "layer[scrollarea].scrolltocenter(0,0);" to the "zoom_out" button's onclick, but it won't do because it would scroll away to the align edge and that would be strange for those who view the map.

    Let's wait for what Klaus would say...

  • Found a way but this is really dirty temporary solution. Spent hours on tweaking it.
    Link
    [EDIT: this solve just one issue there. ]
    Reading loverflow, roverflow, toverflow, boverflow, woverflow, hoverflow have made algorithm to monitor those values and as result to tell me when scroll is in some corner. Than switched alignment and x and y values of it.
    Also this automatic alignment was not perfect so had to make trustful deviation for correct determination of the corners.

    Maybe this solution will give Klaus idea on how to improve scrollarea one day *whistling*

    Einmal editiert, zuletzt von Umalo (22. Dezember 2013 um 02:03)

  • Hi Umalo, Alexey,

    Since I can't see Umalo's example, please let me know If your post is related to the request for help in my post.
    I assume the scrollarea plugin is still on the level of the krpano ver. 1.17.5.

    In any case, do you have some word of wisdom, what I need to consider, when trying to keep the focus in the zooming layer?

    Thank you,
    Pavel

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!