PDA

View Full Version : Bug - imagecontrol - zoom factor



jharp
September 11th, 2021, 02:54
I don't know if this is new or not but here is the issue.

I'm trying to use setViewpoint/setViewpointCenter and it seems that the imagecontrol always ignores the zoom factor.

You can most easily see this happen by launching with any ruleset with any image.

1. Open the image. Close FGU. Look at the windowstate.xml file. You will see the image control settings that it should use when you open the window again.
2. Now launch and view the image again but this time zoom in. Close FGU and you will note that the windowstate.xml updates as expected with a greater zoom.
3. Launch again and open the image and you will see it isn't zoomed.

I've tried with my own code and it gives the same results and it always ignores the zoom factor for the setViewpoint/sVC commands.

Jason

Trenloe
September 11th, 2021, 03:16
Moved to the Unity support forum. The Laboratory forum is for reporting issues in the latest public test version.

jharp
September 11th, 2021, 03:49
A little more details of my testing.

I can make it work if the window has already been established for a time. (I added a button that did only the setViewpoint)
However the following won't work. Maybe my fault cause I'm missing something?

local rWindow = Interface.openWindow("imagewindow","imagename");
local rNewImgCtrl = rWindow.image;
rNewImgCtrl.setViewpoint(1000,800,0.5);

Do I need to move my setViewpoint to code that is in the onFirstLayout() for the imagecontrol?


Either way the method I described in the first post should presumably work since it is saved for it to work on reload.

Jason

jharp
September 11th, 2021, 05:31
I think this is just a timing issue. When I ask it to zoom it isn't done creating the window. You can close this if you wish.

Moon Wizard
September 11th, 2021, 23:21
Thanks for letting us know.

Regards,
JPG