Skip to content

read the valign of a credit-image #454

Description

@webern

<credit-image> is written with the right valign since #451, but reading one still throws the
alignment away, so valign="middle" on a credit image does not survive a round trip.

getImageData reads position data and then discards the vertical alignment
(src/private/mx/impl/PageTextFunctions.cpp:43-47):

out.positionData = getPositionData(image);
out.positionData.verticalAlignment = api::VerticalAlignment::unspecified;

It has to discard it, because the generic getPositionData cannot read a picture's alignment. A
picture uses valign-image (top, middle, bottom) rather than the valign that text uses, and the
generic reader's value getter is compiled out on the type mismatch, so it hands back the default
baseline whenever the attribute is present. Recording that would be worse than recording nothing.

The direction <image> reader already solves this by reading the attribute off the element itself
(src/private/mx/impl/DirectionReader.cpp:978-999). getImageData should do the same.

This is also the reason the writer bug in #444 went unnoticed: no round trip ever carried a
credit-image alignment in for the writer to get wrong.

References

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    aiIssues opened by, or through, a coding agent.bugsoftware defectimplAffects the mx::impl layer

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions