Skip to content

Commit

Permalink
Fix #371
Browse files Browse the repository at this point in the history
  • Loading branch information
hhrutter committed Aug 25, 2021
1 parent befba81 commit 5a7da1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/cli/test/boxes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestCropCommand(t *testing.T) {
s string
u pdfcpu.DisplayUnit
}{
{"0 0 10 0", pdfcpu.POINTS},
{"[0 0 5 5]", pdfcpu.CENTIMETRES},
{"100", pdfcpu.POINTS},
{"20% 40%", pdfcpu.POINTS},
Expand Down
2 changes: 1 addition & 1 deletion pkg/pdfcpu/boxes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ func applyBox(boxName string, b *Box, d Dict, parent *Rectangle) *Rectangle {
}

mLeft, mRight, mTop, mBot := b.MLeft, b.MRight, b.MTop, b.MBot
if -1 < b.MLeft && b.MLeft < 1 {
if b.MLeft != 0 && -1 < b.MLeft && b.MLeft < 1 {
// Margins relative to media box
mLeft *= parent.Width()
mRight *= parent.Width()
Expand Down

0 comments on commit 5a7da1d

Please sign in to comment.