I am trying to make a method which changes the view (2D) of my model window based on the objects which I have selected. The model window should be such that all of the selected objects are visible in the window.
I have tried to use the functions .zoomFactor,.getXYWH and setXYWH. but without much success so far.
Therefor I am wondering if it is possible to make such a method and what functions are needed for it. Any ideas?
example for one selected object (without zoom):
-- get size and position of selected object
-- get size of frame
-- set new size of frame
-- scroll to position of selected object
when the new size is too large you may set zoomfactor of the frame.
Thank you for your quick response.
Been testing the code you sent to me.
Not working entirely yet for multiple object selection but tweaking it at the moment.