From b8afaae2940a6020e8593a4e83ee9036b9f97666 Mon Sep 17 00:00:00 2001 From: Luca Furini Date: Mon, 7 Jul 2008 13:52:36 +0000 Subject: Fixing absolute positioning of block-containers: bottom and right distances were not taken into account git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@674489 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/BlockContainerLayoutManager.java | 9 +++ status.xml | 4 + .../block-container_absolute-position_tblr.xml | 87 ++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index 732cb1ae7..022ba1d90 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -694,9 +694,17 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager int y = 0; if (abProps.left.getEnum() != EN_AUTO) { x = abProps.left.getValue(this); + } else if (abProps.right.getEnum() != EN_AUTO + && width.getEnum() != EN_AUTO) { + x = getReferenceAreaIPD() + - abProps.right.getValue(this) - width.getValue(this); } if (abProps.top.getEnum() != EN_AUTO) { y = abProps.top.getValue(this); + } else if (abProps.bottom.getEnum() != EN_AUTO + && height.getEnum() != EN_AUTO) { + y = getReferenceAreaBPD() + - abProps.bottom.getValue(this) - height.getValue(this); } return new Point(x, y); } @@ -1085,3 +1093,4 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager } + diff --git a/status.xml b/status.xml index 5bbcd4bd1..4dc8b9d05 100644 --- a/status.xml +++ b/status.xml @@ -53,6 +53,10 @@ + + Fixed absolute positioning of block-containers when specified + using right and bottom instead of left and top. + Added PDF encryption parameter support in configuration. diff --git a/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml b/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml new file mode 100644 index 000000000..f9919d2c1 --- /dev/null +++ b/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml @@ -0,0 +1,87 @@ + + + + + +

+ This test checks absolutely positioned block-containers using top, bottom, left and right distances +

+
+ + + + + + + + + + position + NOT ok! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-- cgit v1.2.3