Skip to content

Commit

Permalink
Calculate stroke weight in JS the same as in Go
Browse files Browse the repository at this point in the history
  • Loading branch information
mk12 committed Sep 7, 2015
1 parent 8b976bf commit 9faa519
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion static/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ window.onload = function() {

thicknessRange.addEventListener('change', function() {
_thickness = thicknessRange.value;
var rect = curveDiv.firstElementChild.viewBox.baseVal;
var adjusted = _thickness * Math.max(rect.width, rect.height) / 600.0;
updateURL();
setStyle('stroke-width', _thickness);
setStyle('stroke-width', adjusted);
});

extraForm.addEventListener('submit', function(e) {
Expand Down

0 comments on commit 9faa519

Please sign in to comment.