Showbase aspect2d fields


I am using Showbase fields such a2dTop, a2dLeft, etc. in some conversion routines and I noticed a small issue.
When my application started, initially a window opened having the size and position declared in PANDA_DIR/etc/Config.prc. That window had a 4:3 aspect ratio.

My application then changed the window size to 640x640 and thus the aspect ration should now be 1:1.

However the above mention fields still indicated a 4:3 ratio, specifically a2dRight - a2dLeft equalled 1.33 instead of 1.0.

Is there perhaps an issue of updating these fields when the main window is re-opened?


You could try calling base._ShowBase__windowEvent(yourWindow).

Or less hacky:

messenger.send("window-event", [yourWindow])

Thanks, it works fine now!