Bug 154065 - chart labels and text shifted in exported PNG if an object goes beyond chart area
Summary: chart labels and text shifted in exported PNG if an object goes beyond chart ...
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard:
Keywords: bibisectNotNeeded, regression
Depends on:
Blocks: Chart regression-scaled-glyph-positions
  Show dependency treegraph
 
Reported: 2023-03-08 11:18 UTC by Stéphane Guillou (stragu)
Modified: 2024-02-28 12:48 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
comparison of PNG exports in 7.4.5 and 7.6.0 (90.22 KB, image/png)
2023-03-08 11:18 UTC, Stéphane Guillou (stragu)
Details
chart with draw object extending over its edge -- exports to PNG showing 7.5.1 against 7.6.0 (101.49 KB, image/png)
2023-03-08 14:42 UTC, V Stuart Foote
Details
example ODS with drawing object extending beyond chart (20.41 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-09-06 20:16 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2023-03-08 11:18:24 UTC
Created attachment 185839 [details]
comparison of PNG exports in 7.4.5 and 7.6.0

Since bug 153672 was fixed with commit ba42b8b95b2166f9bd578cd90c54e9826a755a6e, labels in exported PNG are shifted if an object goes beyond the chart area.

I checked if the shift was present before the regression commit 1fa731d03ba0f22cb9392a578124ea977eaab2e9, and even though the plot was out of whack (maybe due to Caolán's work in progress at the time), the text was not shifted relative to other chart elements.

Steps:
1. open attachment 185553 [details]
2. Right-click on top-left chart > Export as Image > use PNG format

Results:
All text is shifted to the right.

Text is not shifted in 7.4.

SVG export is not affected.

Should probably be fixed with bug 153792 taken into account.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 288c0920a8475f9f2c537212e04aa7649192ad8c
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 1 Stéphane Guillou (stragu) 2023-03-08 12:59:46 UTC
Same on Windows 10.
Comment 2 V Stuart Foote 2023-03-08 14:09:30 UTC
Confirmed the situation at 7.6.0, all text is there but is translated too far right in the x-axis but y-axis looks correct

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 55360ba58f33f3f45c83decce092c43d25c4e48c
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

but it is even worse at 7.5.1.2, text is translated too far negative on the x-axis and positive on the y-axis

Version: 7.5.1.2 (X86_64) / LibreOffice Community
Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 3 V Stuart Foote 2023-03-08 14:23:56 UTC
Also, doing an export as PNG for the chart on the "data_and_chart" sheet where the arrow line end is inside the chart, text is correctly positioned with trunk against 7.6.0

While for the same chart at 7.5.1.2 the text is translated negative on the x-axis and positive on the y-axis.

So actually much improved with trunk. Issue is with the extent and origin of the grouped objects? Placement for text is miscalculated when one of the draw objects extends beyond the chart bounds.
Comment 4 V Stuart Foote 2023-03-08 14:42:52 UTC
Created attachment 185845 [details]
chart with draw object extending over its edge -- exports to PNG showing 7.5.1 against 7.6.0

on top left is chart export from 7.5.1.2 on top right is same chart from trunk against 7.6.0 -- the draw object arrow line extends beyond chart edge

the bottom left is 7.5.1.2 export, and bottom right is from trunk of the chart from the "data_and_chart" sheet where the arrow line draw object was inside extend of the chart.  Positioning in trunk seems correct.
Comment 5 Stéphane Guillou (stragu) 2023-03-08 14:47:16 UTC
Thanks Stuart.

(In reply to V Stuart Foote from comment #2)
> but it is even worse at 7.5.1.2, text is translated too far negative on the
> x-axis and positive on the y-axis

That's because the fix for bug 153672 was merged in 7.6 but not yet for 7.5 (should land in 7.5.2). The very bad reshuffling you see is the effect of that regression. Which is why I had 7.6 as earliest affected.

To avoid the effect of the regression reported in bug 153672, please compare 7.6 with 7.4 (like in my screenshot). You'll see that relative positions of chart elements and text is correct in 7.4.
Comment 6 V Stuart Foote 2023-03-08 15:25:22 UTC
(In reply to Stéphane Guillou (stragu) from comment #5)

OK, I understood. Meaning the https://gerrit.libreoffice.org/c/core/+/148136 patch may have left some vclprocessor2d handling undone. 

But as noted on bug 153792, how can you manipulate a chart in Calc to end up with a draw object extending beyond the chart extent?

So while there may be some slippage against 7.4.6, not clear this is even a legitimate issue. I can recreate the sample chart.
Comment 7 V Stuart Foote 2023-03-08 15:26:15 UTC
(In reply to V Stuart Foote from comment #6)
> I can recreate the sample chart.

s/can/can not/
Comment 8 Stéphane Guillou (stragu) 2023-09-06 20:16:58 UTC
Created attachment 189397 [details]
example ODS with drawing object extending beyond chart

(In reply to V Stuart Foote from comment #6)
> But as noted on bug 153792, how can you manipulate a chart in Calc to end up
> with a draw object extending beyond the chart extent?

1. Draw a long line, copy it
2. Insert a chart
3. Paste the line inside the chart