Resizing a window with Shift to keep ration Width/Height
Miklos Vajna
vmiklos at collabora.com
Mon Apr 7 06:42:58 UTC 2025
Hi Laurent,
On Sat, Apr 05, 2025 at 02:21:14PM +0200, Laurent Balland <laurent.balland at mailo.fr> wrote:
> But it is not used for charts. I noticed that the rules to make proportional
> with or without Shift are different between drawing objets and charts :
>
> - for Drawing objects: default is not proportional
>
> - for Chart and Pictures: default is proportional for corners handles and
> not proportional for edge handles
>
> Does anyone has some code pointers for resizing a picture or a chart?
Writer text frames and pictures are resized in
SwVirtFlyDrawObj::NbcResize(), but that's a bit different: the relative
width or height of a picture can be set to "sync", in which case it's
calculated automatically to match the other axis, keeping the aspect
ratio unchanged.
SwVirtFlyDrawObj::NbcResize() is only called when you release the mouse
with the resize, so there must be other code earlier which already does
the proportional (or not) resize for the preview of the resize.
Perhaps you can put a breakpoint on that function, get a backtrace and
that may lead you to that place.
Regards,
Miklos
More information about the LibreOffice
mailing list