Skip to content

Commit

Permalink
Updated to BWIPP 2016-12-16 and a couple of bug fixes (#53, #55)
Browse files Browse the repository at this point in the history
  • Loading branch information
metafloor committed Dec 21, 2016
1 parent 1ed8519 commit a618371
Show file tree
Hide file tree
Showing 6 changed files with 22,115 additions and 22,076 deletions.
16 changes: 16 additions & 0 deletions demo/bwipjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,22 @@ BWIPJS.prototype.stroke = function() {
}
this.g_path = [];
}

// Fix sources of rounding error by making the scale-factors integral.
// Currently, only floor is being used.
BWIPJS.prototype.floorscale = function() {
this.g_tsx = Math.floor(this.g_tsx) || 1;
this.g_tsy = Math.floor(this.g_tsy) || 1;
}
BWIPJS.prototype.ceilscale = function() {
this.g_tsx = Math.ceil(this.g_tsx) || 1;
this.g_tsy = Math.ceil(this.g_tsy) || 1;
}
BWIPJS.prototype.roundscale = function() {
this.g_tsx = Math.round(this.g_tsx) || 1;
this.g_tsy = Math.round(this.g_tsy) || 1;
}

BWIPJS.prototype.setextent = function() {
if (!this.g_path.length) // Nothing to do?
return;
Expand Down
6 changes: 3 additions & 3 deletions demo/bwipp-min.js

Large diffs are not rendered by default.

Loading

0 comments on commit a618371

Please sign in to comment.