1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
<events name="flatpano_events" onnewpano="flatpano_startup();" onresize="flatpano_imagefit();" />
<!-- setup the view to show the whole image at startup -->
<action name="flatpano_startup">
div(pano_aspectratio, image.hfov, image.vfov);
div(screen_aspectratio, area.pixelwidth, area.pixelheight);
if(pano_aspectratio GT screen_aspectratio,
set(view.fovtype, HFOV);
copy(view.fov, image.hfov);
copy(view.fovmax, image.hfov);
,
set(view.fovtype, VFOV);
copy(view.fov, image.vfov);
copy(view.fovmax, image.vfov);
);
</action>
<!-- adjust the fov limits during resizing -->
<action name="flatpano_imagefit">
if(image.vfov GT 0,
div(pano_aspectratio, image.hfov, image.vfov);
div(screen_aspectratio, area.pixelwidth, area.pixelheight);
if(pano_aspectratio GT screen_aspectratio,
if(view.fovtype == VFOV,
remapfovtype(view.fov, VFOV, HFOV, lastresize_width, lastresize_height);
set(view.fovtype, HFOV);
copy(view.fovmax, image.hfov);
);
,
if(view.fovtype == HFOV,
remapfovtype(view.fov, HFOV, VFOV, lastresize_width, lastresize_height);
set(view.fovtype, VFOV);
copy(view.fovmax, image.vfov);
);
);
);
set(lastresize_width, get(area.pixelwidth));
set(lastresize_height, get(area.pixelheight));
</action>
|