Bug 163816 - When resizing the chart area, keep the aspect ratio when shift is being pressed
Summary: When resizing the chart area, keep the aspect ratio when shift is being pressed
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Laurent Balland
URL:
Whiteboard:
Keywords:
: 99218 (view as bug list)
Depends on:
Blocks: Chart
  Show dependency treegraph
 
Reported: 2024-11-08 07:53 UTC by Eyal Rozenberg
Modified: 2025-04-05 15:54 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2024-11-08 07:53:57 UTC
The aspect ratio, or proportion of height to width is an important feature of many objects in LO, and specifically of chart areas. Unfortunately, while some objects, such as drawing shapes, can be resized while maintaining proportions, e.g. using Shift-drag, Chart areas cannot. That is, there is no way to force LO to restrict you to aspect-ratio-maintaining resizing. Charts should at least respect Shift-drag for proportional resizing of the chart area.
Comment 1 Eyal Rozenberg 2024-11-08 07:54:26 UTC
... and I'd say this is a bug since it breaks behavior consistency with other resizable entities for no reason.
Comment 2 Heiko Tietze 2024-11-08 08:01:25 UTC
Please provide STR. When I resize the chart from bug 163807 the pie remains proportional either in chart edit mode, ie. you only touch the pie, or the view mode and resize the entire object.
Comment 3 Eyal Rozenberg 2024-11-08 08:17:44 UTC
(In reply to Heiko Tietze from comment #2)
> Please provide STR. When I resize the chart from bug 163807

Note I said resizing the chart _area_ - within the chart, not resizing the chart as an object. And the steps to reproduce are:

1. Create some chart (e.g. pie or bar)
2. Enter the chart
3. Select the Chart Area
4. Resize by Shift+dragging
Comment 4 QA Administrators 2024-11-09 03:15:31 UTC Comment hidden (obsolete)
Comment 5 Regina Henschel 2024-11-14 14:00:52 UTC
When the chart is in edit mode, resizing is not possible with keeping ratio. More, numerical resizing is not possible at all.

For me it is a valid request to enhance the UI for resizing a chart in edit mode.
Comment 6 Rafael Lima 2024-11-19 18:45:05 UTC
+1 from my side.

This change would affect all embedded objects.

Code pointer is: SvResizeWindow::MouseMove

In: toolkit/source/hatchwindow/ipwin.cxx
Comment 7 Heiko Tietze 2024-11-21 07:57:47 UTC
We discussed the topic in the design meeting.

Bar charts and other always resize unconditional but sometimes it makes sense to retain the aspect ratio. We propose to introduce the same behavior as known from objects in the document namely to keep the ratio if shift is being pressed.
Comment 8 Laurent Balland 2025-03-22 14:23:24 UTC
Patch under review:
https://gerrit.libreoffice.org/c/core/+/177588

Tests are welcome ;-)

I also added Shift+Drag on borders = move horizontal/vertical/45°
Comment 9 Laurent Balland 2025-04-05 12:22:55 UTC
*** Bug 99218 has been marked as a duplicate of this bug. ***
Comment 10 Regina Henschel 2025-04-05 15:33:19 UTC
(In reply to Heiko Tietze from comment #7)
> We discussed the topic in the design meeting.
> 
> Bar charts and other always resize unconditional but sometimes it makes
> sense to retain the aspect ratio. We propose to introduce the same behavior
> as known from objects in the document namely to keep the ratio if shift is
> being pressed.

The desired behavior is not clear.
A chart is an OLE object and as that it can be activated (be in edit mode) or not.
If it is not active, it behaves same as other shape objects. The default behavior in Writer and Calc is, that dragging the corner handle keeps ratio and dragging the edge handle allows to change width/height ratio. Pressing shift toggles the behavior so that dragging corner handle does not keep ratio and dragging edge handle keeps ratio.
Draw/Impress have the additional setting "Constrain Objects: When creating or moving objects" in Tools > Options > Draw/Impress > Grid. This option toggles which of the two behaviors is the default one.
In case of a not activated chart, the current behavior is correct and nothing should be changed.

If a chart is in edit mode, then currently, when dragging any handle, then the chart area (=outer frame) size is freely resized and the shift modifier has no effect at all.

So my question: Is the request, that in edit mode the handles of the chart area frame should behave the same as the handles do in not-actived mode?
Comment 11 Laurent Balland 2025-04-05 15:54:30 UTC
(In reply to Regina Henschel from comment #10)
> So my question: Is the request, that in edit mode the handles of the chart
> area frame should behave the same as the handles do in not-actived mode?
Yes, it is how I understand the request (now). The proposed patch does not reflect this request (yet), but I propose to mimic the behavior of the not-activated mode.