Skip to content

Commit

Permalink
Add borders for images, text and view elements (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
KerenChandran authored and diegomura committed Sep 5, 2017
1 parent 83763df commit daa8f07
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 0 deletions.
Binary file modified examples/fractals/output.pdf
Binary file not shown.
Binary file modified examples/images/output.pdf
Binary file not shown.
Binary file modified examples/page-layout/output.pdf
Binary file not shown.
Binary file modified examples/text/output.pdf
Binary file not shown.
Binary file modified packages/react-pdf/specs/__snapshots__/fontSpec.js.snap
Binary file not shown.
Binary file modified packages/react-pdf/specs/__snapshots__/imageSpec.js.snap
Binary file not shown.
Binary file modified packages/react-pdf/specs/__snapshots__/linkSpec.js.snap
Binary file not shown.
Binary file modified packages/react-pdf/specs/__snapshots__/textSpec.js.snap
Binary file not shown.
1 change: 1 addition & 0 deletions packages/react-pdf/src/elements/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class Image extends Base {
const { left, top, width, height } = this.getAbsoluteLayout();

this.drawBackgroundColor();
this.drawBorders();

this.root.image(this.image.data, left + padding.left, top + padding.top, {
width: width - padding.left - padding.right,
Expand Down
1 change: 1 addition & 0 deletions packages/react-pdf/src/elements/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class Text extends Base {
const { fontSize = 18, color = 'black' } = this.style;

this.drawBackgroundColor();
this.drawBorders();

// Set coordinates, dimentions and continued text
// Increase a bit the width and height of the text or excecution freezes.
Expand Down
1 change: 1 addition & 0 deletions packages/react-pdf/src/elements/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class View extends Base {

async render() {
this.drawBackgroundColor();
this.drawBorders();

await this.renderChildren();
}
Expand Down

0 comments on commit daa8f07

Please sign in to comment.