Trying to understand wheeldelta_raw

  • Hi all! *wink*

    I was playing around with 'zoom into layer' example the other day and wanted to make the zooming a bit smoother. So I tried to use tweening and 'wheeldelta_raw' variable (docu says this is unrounded mouse wheel delta). However, when I trace both wheeldelta and wheeldelta_raw, I get +3 or -3 for wheeldelta (that's normal) and +1 or -1 for wheeldelta_raw. Only when I work hard with mousewheel I get greater values. It seems that wheeldelta_raw is always three times smaller than wheeldelta variable.

    I wonder, is this some kind of bug or is it nromal?

    I expected to get some unrounded values here, something like 3.6758675 or similar.

  • Hi,

    that wheeldelta_raw was mainly designed as workaround for Flashplayer limitations - some mouses where sending small values like 0.123 as delta, but inside the Flash the Flashplayer was only reporting integer delta values. So that delta was always 0 and by this it was impossible to zoom on some systems.

    So as workaround krpano was capturing the mouse-wheel events externally via Javascript (because there the values were not rounded to integer) and then sending that 'raw' wheel-delta to the krpano Flash viewer to allow zooming there.

    Later when the HTML5 viewer was developed, there was basically no need for a wheeldelta_raw, but to keep compatibility with the Flash viewer it's there and it simulates the same values as in Flash by scaling the delta by 3. But there is no rounding or something else in krpano.

    Best regards,
    Klaus

Jetzt mitmachen!

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