Created attachment 180349 [details] Shapes anchored "to character" vertical positioned "to character" ODF 1.3 defines that the anchor is "The character after the drawing shape element." in section 19.759 text:anchor-type. Thereby not the visual appearance but the position in the file markup is meant. The attached document "Anchor character is tall before shape.odt" has two rectangles with position "top" and "bottom" respectively. You see, that the vertical position corresponds to the character "|", which has a font size 96pt. When you open the content.xml of the file in editor, then you see, that the character "|" is before the rectangles. I think, that the reference area for the vertical position should not be the character before the object but the anchor character, and that has to be the character after the object. If you drag the anchor one character to the left or right, you see that the reference area for the vertical position changes, which means, that in case of "to character" really a character area is used, in contrast to "to Line of Text" where the entire line area is used as reference area for vertical position.
(In reply to Regina Henschel from comment #0) Restating -- to be sure.... Using: 1. "to character" anchor 2. with "Vertical" positioning "to" "Character" I understand that ODF is referring to file contents not appearance, but I think your descriptions here are from the user POV. (not a problem, because the description is clear, just confirming what is being described). > reference area for the vertical position should not be the > character before the object in UI: reference area ... should not be character before the anchor position. > but the anchor character, and that has to be the character after the object. but the implementation should use the character immediately after the character where the anchor appears. For example: 40 40 40 96 96 40 40 (each number indicates a character and its pt. size) 1. Place anchor on first 96. Actual: vertical positioning uses 40 Expected: uses 96 2. Place anchor on second 96 Actual: vertical positioning uses 96 Expected: uses 40 (Example tested using attachment 180349 [details], and adding a 96 pt character) Version: 7.4.0.0.alpha1+ (x64) / LibreOffice Community Build ID: 09822cf77cdbe32b03553cd05154100b5f2591d0 CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: default; VCL: win Locale: da-DK (da_DK); UI: en-US Calc: threaded > When you open the content.xml of the file in editor, then you see, that the > character "|" is before the rectangles. Confirm. In this case, both draw:rect are after "|" (which is used as anchor) According to section 19.759, for text:anchor-type:char The drawing shape element shall be located in file text…Just before the character. Additional test: 1. Add a second 96 pt. character next to the one in the attachment. 2. Move the anchor for the lower red rectangle to another character (I used "d" at the start of the line). 3. Put the anchor for the upper red rectangle on the second 96 pt. character 4. Inspect the content.xml Actual and expected: The draw:rect is BEFORE the anchor character. => NEEDINFO 1. Can you repro "Additional test"? 2. If so, maybe problem is related to >1 anchor per character?
Should also have mentioned.... Even though the content.xml of the "Additional test" looks correct according to ODF 1.3, the appearance to the user is still as in the original test: the area of the character before the anchor location is used to position the rectangle.
(In reply to sdc.blanco from comment #1) > 1. Add a second 96 pt. character next to the one in the attachment. > 2. Move the anchor for the lower red rectangle to another character (I used > "d" at the start of the line). > 3. Put the anchor for the upper red rectangle on the second 96 pt. character > 4. Inspect the content.xml > > Actual and expected: The draw:rect is BEFORE the anchor character. Yes. > > => NEEDINFO > > 1. Can you repro "Additional test"? > 2. If so, maybe problem is related to >1 anchor per character? I do not understand, what this "Additional test" should show. The problem is, that not the anchor character, but the character left from the anchor character is used for calculating the position.
(In reply to Regina Henschel from comment #3) > The problem is, that not the anchor character, but the character left > from the anchor character is used for calculating the position. I can confirm this. Have changed Bug summary to make the issue more salient, but please check that the description is accurate.
(In reply to Regina Henschel from comment #3) > I do not understand, what this "Additional test" should show. Is there some relation between the contents of contents.xml and the character used for positioning? If not, then the "Additional test" may not be so relevant. Fwiw, the issue arose because in comment 0: > When you open the content.xml of the file in editor, then you see, that the > character "|" is before the rectangles. The "Additional test" shows a case where the "|" is after the rectangle. (but still positions in relation to the character to the "immediate left" of the anchor character.)