Skip to content

Commit

Permalink
Fixed bug when margin was set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
lindell committed Mar 29, 2016
1 parent 483f5d9 commit a612eae
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions JsBarcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@
options = merge(JsBarcode.defaults, options);

// Fix the margins
options.marginTop = options.marginTop || options.margin;
options.marginBottom = options.marginBottom || options.margin;
options.marginRight = options.marginRight || options.margin;
options.marginLeft = options.marginLeft || options.margin;
options.marginTop = typeof options.marginTop === "undefined" ?
options.margin : options.marginTop;
options.marginBottom = typeof options.marginBottom === "undefined" ?
options.margin : options.marginBottom;
options.marginRight = typeof options.marginRight === "undefined" ?
options.margin : options.marginRight;
options.marginLeft = typeof options.marginLeft === "undefined" ?
options.margin : options.marginLeft;

//Abort if the browser does not support HTML5 canvas
if (!canvas.getContext) {
Expand Down

0 comments on commit a612eae

Please sign in to comment.