Bug 150901 - FILEOPEN DOCX better position for text frame in rotated shape
Summary: FILEOPEN DOCX better position for text frame in rotated shape
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: DOCX-Textbox
  Show dependency treegraph
 
Reported: 2022-09-10 20:29 UTC by Regina Henschel
Modified: 2022-10-02 08:37 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example document to see the current bad position (39.13 KB, application/zip)
2022-09-10 20:29 UTC, Regina Henschel
Details
Analyse of the current bad position (50.08 KB, image/png)
2022-09-10 20:30 UTC, Regina Henschel
Details
Proposed better position (69.25 KB, image/png)
2022-09-10 20:32 UTC, Regina Henschel
Details
Original document with added blue rectangle (13.18 KB, application/zip)
2022-09-10 20:34 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2022-09-10 20:29:59 UTC
Created attachment 182351 [details]
Example document to see the current bad position

Currently the position of the text frame is calculated this way:
1. Get left distance L from the left edge of the text area rectangle to the left edge of the un-rotated shape.
2. Get top distance T from the top edge of the text area rectangle to the top edge of the un-rotated shape.
3. Get the snap-rectangle of the rotated shape
4. Set the top of the text area rectangle distance T down to the top of the snap-rectangle.
5. Set the left of the text area rectangle distance L right from the left edge of the snap-rectangle.
That positiones the text area rectangle far away from the place it has in Word.

I suggest to use this way:
1. Get the center C of the text area rectangle of the un-rotated shape.
2. Rotate this point C the same way as the shape is rotated (which means a rotation around the center of the shape). You get a point C'.
3. Position the text area rectangle so, that its center coincides with C'.
Comment 1 Regina Henschel 2022-09-10 20:30:49 UTC
Created attachment 182352 [details]
Analyse of the current bad position
Comment 2 Regina Henschel 2022-09-10 20:32:01 UTC
Created attachment 182353 [details]
Proposed better position

The blue rectangle is the position, which I propose for the text area rectangle.
Comment 3 Regina Henschel 2022-09-10 20:34:00 UTC
Created attachment 182354 [details]
Original document with added blue rectangle

This is the original document with blue rectangle added with the position I propose. Open it in Word to see, that this position is near to the original text position in Word.
Comment 4 Dieter 2022-10-02 08:37:19 UTC
Regina, I agree, that improvement is needed here and your suggestion sounds reasonable to me. So I change status to NEW, but I'm not an expert in this field.