Skip to content

Commit 91bdc7d

Browse files
author
Ben Gribaudo
committed
DRYing line()
Removing duplication of logic. Switching line() from directly outputting to the PDF to calling lines().
1 parent a516aac commit 91bdc7d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

jspdf.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -994,10 +994,7 @@ var jsPDF = (function(global) {
994994
};
995995

996996
API.line = function(x1, y1, x2, y2) {
997-
out(
998-
f2(x1 * k) + ' ' + f2((pageHeight - y1) * k) + ' m ' +
999-
f2(x2 * k) + ' ' + f2((pageHeight - y2) * k) + ' l S');
1000-
return this;
997+
return this.lines([[x2 - x1, y2 - y1]], x1, y1);
1001998
};
1002999

10031000
/**

0 commit comments

Comments
 (0)