Very strange behaviour with png images (scaling works, positioning doesn't)

  • Dear Klaus,

    since about yesterday I'm experiencing a very strange behaviour in one of my custom developed plugins. I'm constantly developing them, so it's possible I made some errors, but I can't figure out what it is.

    This is a custom map plugin, which the user can scale up/down, and move around. The scaling works just fine, but the positioning stopped working.

    So this code

    Code
    plugin.scale -= (eventDelta / 500);

    works, and I can see it resizing as I scroll with the mousewheel, however this code

    Code
    var xPos = krpano.get("mouse.stagex") - dragCenterXOffset;
    var yPos = krpano.get("mouse.stagey") - dragCenterYOffset;
    
    
    plugin.x = xPos;
    plugin.y = yPos;
    
    
    console.log(plugin.name + "   x=" + plugin.x + "   y=" + plugin.y);

    doesn't work, even though I can see in the console that the x and y values are getting updated...nothing happens visually though.

    Now comes the fun part...I attached two images, ones we use for these kinds of maps. Both are png-s, both have some transparent areas, although type1 has much more of it than type2. However, all of the above only happens with images like type2, and the code works just fine with images like type2. Just to be clear, the scaling part works on both.

    I am completely clueless at the moment...any ideas on what might be causing this?

  • Yet another occurrence of - I can only presume the same phenomenon - is that normally I have a black colored container layer acting as a background when these map images are zoomed in (to hide what's underneath), and what happens with images of type1, is that on iOS they get behind the background layer even though the zorder of it is higher than that of the bg layer. With images of type 2 this does not occur.

    Sorry, I don't know how to take screenshots on iOS, but I made two shots with another phone, see attached. On the left you can see png type 2, with correct zorders and on the right side there's a type 1, with the map image somehow stuck behind the bg layer...

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!