Skip to content

Commit

Permalink
#472 - Tests for transformed fixed and transformed fixed custom objec…
Browse files Browse the repository at this point in the history
…t (watermark).

It turns out it only needed the left and top properties defined in the html.
  • Loading branch information
danfickle committed Oct 18, 2020
1 parent 554a3d9 commit f14e3b8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
height: 100%;
transform: rotate(45deg);
z-index: 1000;
left: 0;
top: 0;
}
</style>
</head>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<html>
<head>
<style>
@page {
size: 200px 200px;
margin: 40px;
}
body, html {
margin: 0;
}
</style>
</head>
<body>
<div style="position: fixed; transform: rotate(45deg); width: 50px; height: 50px; background-color: red; border: 5px solid purple; padding: 10px; margin: 10px; left: 20px; top: 10px;"></div>
<div style="page-break-after: always;"><div style="border-bottom: 1px solid orange;"></div></div>
<div style="border-bottom: 1px solid red;"></div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,6 @@ public void testIssue472CustomObjectDrawerMultiplePages() throws IOException {
* inside a fixed position object.
*/
@Test
@Ignore // Works well on the first page, but not positioned correctly on
// subsequent pages.
public void testIssue472AddSemiTransparentWatermark() throws IOException {
assertTrue(vtester.runTest("issue-472-add-semi-transparent-watermark", builder -> {
builder.useFont(new File("target/test/visual-tests/Karla-Bold.ttf"), "Karla", 700, FontStyle.NORMAL, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,15 @@ public void testTransformWithinTransform() throws IOException {
assertTrue(vt.runTest("transform-inside-transform"));
}

/**
* Tests that a transformed element with fixed position works on
* multiple pages.
*/
@Test
public void testTransformFixed() throws IOException {
assertTrue(vt.runTest("transform-fixed"));
}

/**
* With single static block, rotate then translate, small page margin, no block margin or padding.
*/
Expand Down

0 comments on commit f14e3b8

Please # to comment.