aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2008-01-17 13:37:04 +0000
committerJeremias Maerki <jeremias@apache.org>2008-01-17 13:37:04 +0000
commit341da37f0397ee32757588ffe5d72b63ef51db5b (patch)
tree98ce246936721a8df7b736698cfc0328ad5c86b6 /test
parent5b110dff04202cb6e9fd4181e231715b96372cc6 (diff)
downloadxmlgraphics-fop-341da37f0397ee32757588ffe5d72b63ef51db5b.tar.gz
xmlgraphics-fop-341da37f0397ee32757588ffe5d72b63ef51db5b.zip
Fixed logic error setting the transformation matrix for block-container viewports (applies to absolute and fixed block-containers only). The CTM now only rotates and shifts the content as necessary for reference-orientation and writing-mode. All the rest of the transformation is done by the renderer which allows to add additional transformations as made possible by fox:transform (see below).
Important: External renderer implementations need to adjust for the change and implement the new method concatenateTransformationMatrix(AffineTransform) if the renderer is derived from AbstractPathOrientedRenderer. New extension attribute fox:transform on fo:block-container allows free-form transformation (rotation, scaling etc.) of absolute and fixed block-containers. Supported only for PDF, PS and Java2D-based renderers. Added missing region background painting for PCL renderer. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@612815 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/layoutengine/standard-testcases/block-container_absolute-position_display-align.xml10
-rw-r--r--test/layoutengine/standard-testcases/block-container_absolute-position_fixed.xml4
-rw-r--r--test/layoutengine/standard-testcases/block-container_absolute-position_fox-transform.xml54
3 files changed, 61 insertions, 7 deletions
diff --git a/test/layoutengine/standard-testcases/block-container_absolute-position_display-align.xml b/test/layoutengine/standard-testcases/block-container_absolute-position_display-align.xml
index 6fb1916c6..667d2a37c 100644
--- a/test/layoutengine/standard-testcases/block-container_absolute-position_display-align.xml
+++ b/test/layoutengine/standard-testcases/block-container_absolute-position_display-align.xml
@@ -58,7 +58,7 @@
<checks>
<!-- first block-container -->
<true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@is-viewport-area"/>
- <eval expected="[1.0 0.0 0.0 1.0 10000.0 10000.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@ctm"/>
+ <eval expected="[1.0 0.0 0.0 1.0 0.0 0.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@ctm"/>
<eval expected="150000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@ipd"/>
<eval expected="150000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@ipda"/>
<eval expected="100000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@bpd"/>
@@ -74,7 +74,7 @@
<!-- second block-container -->
<true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@is-viewport-area"/>
- <eval expected="[0.0 -1.0 1.0 0.0 190000.0 160000.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@ctm"/>
+ <eval expected="[0.0 -1.0 1.0 0.0 0.0 150000.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@ctm"/>
<eval expected="100000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@ipd"/>
<eval expected="100000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@ipda"/>
<eval expected="150000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@bpd"/>
@@ -90,7 +90,7 @@
<!-- third block-container -->
<true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/@is-viewport-area"/>
- <eval expected="[-1.0 -0.0 0.0 -1.0 160000.0 290000.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/@ctm"/>
+ <eval expected="[-1.0 -0.0 0.0 -1.0 150000.0 100000.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/@ctm"/>
<eval expected="150000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/@ipd"/>
<eval expected="150000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/@ipda"/>
<eval expected="100000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/@bpd"/>
@@ -109,7 +109,7 @@
<!-- fourth block-container -->
<true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@is-viewport-area"/>
- <eval expected="[0.0 1.0 -1.0 0.0 290000.0 190000.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@ctm"/>
+ <eval expected="[0.0 1.0 -1.0 0.0 100000.0 0.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@ctm"/>
<eval expected="100000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@ipd"/>
<eval expected="100000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@ipda"/>
<eval expected="150000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@bpd"/>
@@ -128,7 +128,7 @@
<!-- fifth block-container -->
<true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[5]/@is-viewport-area"/>
- <eval expected="[1.0 0.0 0.0 1.0 30000.0 150000.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[5]/@ctm"/>
+ <eval expected="[1.0 0.0 0.0 1.0 0.0 0.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[5]/@ctm"/>
<eval expected="150000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[5]/@ipd"/>
<eval expected="150000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[5]/@ipda"/>
<eval expected="28800" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[5]/@bpd"/>
diff --git a/test/layoutengine/standard-testcases/block-container_absolute-position_fixed.xml b/test/layoutengine/standard-testcases/block-container_absolute-position_fixed.xml
index 54db8dea7..b35fbadfe 100644
--- a/test/layoutengine/standard-testcases/block-container_absolute-position_fixed.xml
+++ b/test/layoutengine/standard-testcases/block-container_absolute-position_fixed.xml
@@ -56,8 +56,8 @@
<true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@is-viewport-area"/>
<eval expected="fixed" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@positioning"/>
<eval expected="absolute" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@positioning"/>
- <eval expected="[1.0 0.0 0.0 1.0 30000.0 30000.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@ctm"/>
- <eval expected="[1.0 0.0 0.0 1.0 30000.0 30000.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@ctm"/>
+ <eval expected="[1.0 0.0 0.0 1.0 0.0 0.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@ctm"/>
+ <eval expected="[1.0 0.0 0.0 1.0 0.0 0.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@ctm"/>
<eval expected="30000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@left-position"/>
<eval expected="30000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@left-position"/>
<eval expected="30000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@top-position"/>
diff --git a/test/layoutengine/standard-testcases/block-container_absolute-position_fox-transform.xml b/test/layoutengine/standard-testcases/block-container_absolute-position_fox-transform.xml
new file mode 100644
index 000000000..2061ccf77
--- /dev/null
+++ b/test/layoutengine/standard-testcases/block-container_absolute-position_fox-transform.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks absolutely positioned block-containers with fox:transform.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block-container id="ro0" left="10pt" top="10pt" width="150pt" height="100pt" absolute-position="absolute" background-color="orange" margin="0pt" border="solid 5pt" border-top-color="red" reference-orientation="0">
+ <fo:block background-color="yellow" start-indent="0pt" end-indent="0pt">ro = 0</fo:block>
+ </fo:block-container>
+ <fo:block-container id="ro90" left="190pt" top="10pt" width="150pt" height="100pt" absolute-position="absolute" background-color="orange" margin="0pt" border="solid 5pt" border-top-color="red" reference-orientation="90" fox:transform="rotate(2)">
+ <fo:block background-color="yellow" start-indent="0pt" end-indent="0pt">ro = 90</fo:block>
+ </fo:block-container>
+ <fo:block-container id="ro180" left="10pt" top="190pt" width="150pt" height="100pt" absolute-position="absolute" background-color="orange" margin="0pt" border="solid 5pt" border-top-color="red" reference-orientation="180" fox:transform="scale(0.5) skewX(45)">
+ <fo:block background-color="yellow" start-indent="0pt" end-indent="0pt">ro = 180</fo:block>
+ </fo:block-container>
+ <fo:block-container id="ro270" left="190pt" top="190pt" width="150pt" height="100pt" absolute-position="absolute" background-color="orange" margin="0pt" border="solid 5pt" border-top-color="red" reference-orientation="270">
+ <fo:block background-color="yellow" start-indent="0pt" end-indent="0pt">ro = 270</fo:block>
+ </fo:block-container>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
+ <eval expected="rotate(2)" xpath="//block[@prod-id='ro90']/@fox:transform"/>
+ <eval expected="scale(0.5) skewX(45)" xpath="//block[@prod-id='ro180']/@fox:transform"/>
+ </checks>
+</testcase>