none
positionH element's ST_RelFromH values RRS feed

  • Question

  • I'm having difficulties comprehending what the ST_RelFromH values mean, because it seems they don't behave as it's defined in the specification.

    Consider the following document:

    <wp:positionH relativeFrom="leftMargin">
        <wp:posOffset>0</wp:posOffset>
    </wp:positionH>

    The drawing element's position is relative to "Left Margin", which according to specification means the following: Specifies that the horizontal positioning shall be relative to the left margin of the page.

    However, as shown in the screenshot the drawing element ends up being positioned relative to page, why?

    The "Right Margin" value behaves as excepted, specification states: Specifies that the horizontal positioning shall be relative to the right margin of the page.

    And the following is how this positioning is being rendered:

    <wp:positionH relativeFrom="rightMargin">
        <wp:posOffset>0</wp:posOffset>
    </wp:positionH>
    As shown, in this case the positioning is relative to page's right margin.
    Friday, December 14, 2018 11:39 AM

Answers

  • Hi Pusting, 

    This isn't a bug. We are just using the wrong assumption about what Left and Right Margin means (as well as Margin). Margin refers to the bounding rectangle formed by the inside of the page's two margins. The Left Margin is the bounding rectangle formed by the page's left edge and the left margin. Therefore, when aligning or positioning an object, it really means within those bounding rectangles. 

    So the “Absolute” position “to the right of …” is interpreted as position to the right of the left edge of the appropriate rectangle. For the “Margin” rectangle it is left margin. For the “Left Margin” rectangle it is left edge of the page. For the “Right Margin” rectangle it is right margin.

    Hopefully, that clears up the issue you're seeing. 

    Let me know if this makes sense.

    Tom


    Tuesday, December 18, 2018 4:24 AM
    Moderator

All replies

  • Hi Pusting,

    Thank you for your question.  An engineer will contact you soon.


    Bryan S. Burgin Senior Escalation Engineer Microsoft Protocol Open Specifications Team

    Friday, December 14, 2018 4:23 PM
    Moderator
  • Hi Pusting, 

    I just checked [MS-OI29500] and we don't have any specific notes about this. I also tried this and I'm using the "Relative position" option and see this: 

    It looks correct to me. Not sure if there's some difference in versions or something I'm doing differently than you. What version of Word are you using?

    Best regards,
    Tom Jebo
    Sr Escalation Engineer
    Microsoft Open Specifications


    Friday, December 14, 2018 7:20 PM
    Moderator
  • Thank you for the reply, but I'm afraid it's possible that you misunderstood me.
    Can you please take a look at my screenshots again?
    They highlight the problem that I was referring to.

    In short, you're using the "Margin" value instead of the "Left Margin" value.
    My question is regarding the "Left Margin" and "Right Margin" behaviours, they don't seem to be consistent, one starts from page's left edge and other starts from margin's right edge.

    Friday, December 14, 2018 7:36 PM
  • Yes, I do see the behavior now. Thanks for pointing out the difference. Let me see if I can tell what Word is expecting.

    Thanks,

    Tom

    Friday, December 14, 2018 8:17 PM
    Moderator
  • Hi Pusting, 

    Just to update you on this, I'm investigating whether this is a possible bug in the rendering. I see that our file format emission does agree with the UI setting and generally we are consistent. I don't see any issue specifically with the XML we use (WML) or with the UI representation, meaning the Layout dialog. However, we definitely change things when rendering and I don't see any obvious human error on our part when working with this. So I suspect the rendering to be off. 

    I'll let you know soon if this is the case or if there's another explanation. If it's a rendering bug, then it's likely we wouldn't actually document this as a behavior deviation from the standard unless we decide we won't fix it. 

    Thanks for your patience.

    Tom

    Tuesday, December 18, 2018 12:32 AM
    Moderator
  • Hi Pusting, 

    This isn't a bug. We are just using the wrong assumption about what Left and Right Margin means (as well as Margin). Margin refers to the bounding rectangle formed by the inside of the page's two margins. The Left Margin is the bounding rectangle formed by the page's left edge and the left margin. Therefore, when aligning or positioning an object, it really means within those bounding rectangles. 

    So the “Absolute” position “to the right of …” is interpreted as position to the right of the left edge of the appropriate rectangle. For the “Margin” rectangle it is left margin. For the “Left Margin” rectangle it is left edge of the page. For the “Right Margin” rectangle it is right margin.

    Hopefully, that clears up the issue you're seeing. 

    Let me know if this makes sense.

    Tom


    Tuesday, December 18, 2018 4:24 AM
    Moderator