Skip to content

Commit

Permalink
Fix scroll positions for CanvasRenderer (Fix #1259)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasvh committed Dec 7, 2017
1 parent 8b653f8 commit ef5c59e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
@@ -1,8 +1,9 @@
### Changelog ###

#### v1.0.0-alpha2 - TBD ####
* Fix `data-html2canvas-ignore` attribute
* Fix decimal `letter-spacing` values
* Fix scroll positions for CanvasRenderer (#1259)
* Fix `data-html2canvas-ignore` attribute (#1253)
* Fix decimal `letter-spacing` values (#1293)

#### v1.0.0-alpha1 - 5.12.2017 ####
* Complete rewrite of library
Expand Down
2 changes: 1 addition & 1 deletion src/Clone.js
Expand Up @@ -253,7 +253,7 @@ export class DocumentCloner {
}
this.inlineAllImages(clone);
if (node.scrollTop !== 0 || node.scrollLeft !== 0) {
this.scrolledElements.push([node, node.scrollLeft, node.scrollTop]);
this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);
}
switch (node.nodeName) {
case 'CANVAS':
Expand Down
14 changes: 14 additions & 0 deletions tests/reftests/overflow/overflow.html
Expand Up @@ -65,6 +65,20 @@ <h1>Overflow: hidden</h1>

</div>
</div>
<div style="overflow:scroll; height: 100px;" id="scroll">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s

with the release of <div style="border-width:10px 0 5px 0;background:green;">a</div>Letraset sheets containing Lorem Ipsum passages, <img src="../../assets/image.jpg" /> and more recently with desktop publishing software like <b>Aldus PageMaker</b> including versions of Lorem Ipsum.


<div style="overflow:visible;position:relative;"><u>position:relative within a overflow:hidden element</u><br /> <br />

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like <b>Aldus PageMaker</b> including versions of Lorem Ipsum.

</div>
<script>
document.querySelector('#scroll').scrollTo(0, 200);
</script>
</div>
</body>
</html>

0 comments on commit ef5c59e

Please sign in to comment.