Sie sind nicht angemeldet.

1

Montag, 1. Dezember 2014, 10:38

Setting/tweening x,y values modifies the alpha of a plugin?

Dear Klaus,

we have a strange issue with on of our plugins. The code is quite complex, but the point is that we have this section in the code

Quellcode

1
2
3
4
5
6
7
if(tweening_in) {
	krpano.call("tween(plugin[" + mapPlugin.name + "].x," + (mapPlugin.width * Math.min(wScaleFactor, hScaleFactor) / 2) + ",0.25)");
	krpano.call("tween(plugin[" + mapPlugin.name + "].y," + (mapPlugin.height * Math.min(wScaleFactor, hScaleFactor) / 2) + ",0.25)");
} else {
	mapPlugin.x = (mapPlugin.width * Math.min(wScaleFactor, hScaleFactor) / 2);
	mapPlugin.y = (mapPlugin.height * Math.min(wScaleFactor, hScaleFactor) / 2);
}


and this whole section is inside of a function being called in the global onresize event. As you can clearly see all this snippet does is it modifies the x and y attributes of a plugin, either by setting them directly or tweening them, depending on the tweening_in variable. The point here is that obviously none of this code should affect the alpha of the plugin. However, it does, since if I comment it out (just the above), the alpha doesn't change (hence I was saying that the overall code is quite complex but this is the exact part that somehow causes the error). Oh, just to clarify, at this point the plugin in question is hidden, and what happens is that it appears during the onresize, so basically the alpha is somehow getting set to 1.

Is this a bug, or am I missing something here? Thanks in advance!

2

Montag, 1. Dezember 2014, 13:51

Hi,

there is no known bug here and normally it should be impossible that changing the x/y values would modify also the alpha value...

Best regards,
Klaus

3

Montag, 1. Dezember 2014, 22:48

All right, thanks, I will look into it more carefully.