aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWout <wout@impinc.co.uk>2014-06-12 10:58:24 +0200
committerWout <wout@impinc.co.uk>2014-06-12 10:58:24 +0200
commit7eca0940834bc8acb5e495add99c043ba474aa84 (patch)
tree7568b43e67cc5d8b913a63cdbfa6e4fb267c625c
parent4f25891a6b84011752e5d024b4052b847cda51ec (diff)
parentff6089410a03acda00fb8cb2f09ed94d7228dd4c (diff)
downloadsvg.js-7eca0940834bc8acb5e495add99c043ba474aa84.tar.gz
svg.js-7eca0940834bc8acb5e495add99c043ba474aa84.zip
Merge pull request #207 from bryhoyt/patch-1
Offset rbox by window scroll, because getBoundingClientRect changes when...
-rwxr-xr-xsrc/rbox.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rbox.js b/src/rbox.js
index 30779a4..54e08cb 100755
--- a/src/rbox.js
+++ b/src/rbox.js
@@ -46,6 +46,10 @@ SVG.RBox = function(element) {
this.width = box.width /= zoom
this.height = box.height /= zoom
+ /* offset by window scroll position, because getBoundingClientRect changes when window is scrolled */
+ this.x += window.scrollX;
+ this.y += window.scrollY;
+
/* add center, right and bottom */
boxProperties(this)
@@ -69,4 +73,4 @@ SVG.extend(SVG.RBox, {
return b
}
-}) \ No newline at end of file
+})
graphics-fop.git/tree/test/layoutengine/standard-testcases/table-cell_block_keep-with-previous.xml?h=Temp_PDF_in_PDF&id=70d54cb2fad48610abd58e22d962e25e169022dc'>table-cell_block_keep-with-previous.xml
blob: 00257a10a08c12388f708be18379c06af56c0d8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?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 keep-with-previous on content inside tables.
    </p>
  </info>
  <fo>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg" white-space-collapse="true" widows="0" orphans="0">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="normal" page-width="5in" page-height="4.5 * 14.4pt">
          <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>block1</fo:block>
          <fo:table table-layout="fixed">
            <fo:table-column/>
            <fo:table-column/>
            <fo:table-body>
              <fo:table-row>
                <fo:table-cell id="cell1">
                  <fo:block keep-with-previous.within-page="always">line1</fo:block>
                  <fo:block>line2</fo:block>
                </fo:table-cell>
                <fo:table-cell id="cell2">
                  <fo:block>line1</fo:block>
                </fo:table-cell>
              </fo:table-row>
              <fo:table-row>
                <fo:table-cell id="cell3">
                  <fo:block>line1</fo:block>
                </fo:table-cell>
                <fo:table-cell id="cell4">
                  <fo:block keep-with-previous.within-page="always">line1</fo:block>
                </fo:table-cell>
              </fo:table-row>
            </fo:table-body>
          </fo:table>
          <fo:block>block2</fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </fo>
  <checks>
    <element-list category="table-cell" id="cell1">
      <box w="14400"/>
      <penalty w="0" p="0"/>
      <box w="14400"/>
    </element-list>
    <element-list category="table-cell" id="cell2">
      <box w="14400"/>
    </element-list>
    <element-list category="breaker" index="0">
      <box w="14400"/>
      <penalty w="0" p="INF"/>
      <box w="14400"/>
      <penalty w="0" p="INF"/>
      <box w="14400"/>
      <penalty w="0" p="INF"/>
      <box w="14400"/>
      <penalty w="0" p="0"/>
      <box w="14400"/>
      <skip>3</skip>
    </element-list>
  </checks>
</testcase>