[
https://issues.apache.org/jira/browse/FOP-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17750217#comment-17750217
]
Jan Tošovský commented on FOP-3141:
-----------------------------------
In my case, actually,
[CommonAbsolutePosition|https://github.com/apache/xmlgraphics-fop/blob/main/fop-core/src/main/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java]
is invoked, but it lacks the parent context so it is impossible to determine
the container dimensions (and perform the calculation) here.
So the
[BlockContainerLayoutManager|https://github.com/apache/xmlgraphics-fop/blob/main/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java]
turned out to be the better place. There is already some handling in the
setupAreaDimensions method, but this method is not called for either fixed or
absolute values of the absolute-position attribute.
TBH I am not familiar with the spec to decide whether the current code conforms
or not.
> Auto-calculating top/left positions based on bottom/right when height/width
> is provided
> ---------------------------------------------------------------------------------------
>
> Key: FOP-3141
> URL: https://issues.apache.org/jira/browse/FOP-3141
> Project: FOP
> Issue Type: Improvement
> Components: layout/block
> Affects Versions: 2.8
> Reporter: Jan Tošovský
> Priority: Minor
> Attachments: bottom.fo, bottom_current.pdf, bottom_expected.pdf
>
>
> When the block container is to be placed on the bottom edge, it is necessary
> to specify the top position even if the bottom and height attributes are
> specified (so the top position could be auto-calculated).
> I actually try generating some FO files originally designed for XEP, but for
> FOP I have to tweak all these top positions. It is straightforward, but I am
> losing the original semantics (top="18.8cm" instead of more clear bottom="0").
> I could locate the possible place for tweaking:
> [https://github.com/apache/xmlgraphics-fop/blob/main/fop-core/src/main/java/org/apache/fop/fo/properties/CommonRelativePosition.java]
> In the constructor, if the top is zero, but both the bottom and the height
> are non-zero, the top could be calculated. Same for the left and right +
> width).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)