Skip to content

Commit

Permalink
corrected parsing strokeWidth with 'px'
Browse files Browse the repository at this point in the history
  • Loading branch information
kityan committed Sep 7, 2014
1 parent f65be1f commit 4ff8139
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions morfana.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ var config = {} ;

// set default values
configure({
autoStart: true, // start Morfana after loading complete
freezeWord: false, // add vertical padding to word's span or "freeze" word in its inital place
strokeWidth: 1.5, //
autoStart: true, // start Morfana after loading complete
freezeWord: false, // add vertical padding to word's span or "freeze" word in its inital place
strokeWidth: 1.5, // px
stroke: 'rgb(150,150,150)',
disablePointerEvents: true, // add pointer-events: none to each svg
zeroEndingWidthFactor: 0.43
zeroEndingWidthFactor: 0.43 // now: width of "zero-ending" = data.height * zeroEndingWidthFactor + 9
});

// Queue - array for processing words with setInterval()
Expand Down Expand Up @@ -574,6 +574,7 @@ function doQueue() {
*/
function configure(obj) {
$.extend(true, config, obj);
config['strokeWidth'] = parseFloat(config['strokeWidth']);
}


Expand Down
2 changes: 1 addition & 1 deletion tests/game.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/rangy/1.2.3/rangy-core.js"></script>
<script type="text/javascript" src="./../morfana.js"></script>
<script type="text/x-morfana-config">Morfana.configure({strokeWidth: 1.5});</script>
<script type="text/x-morfana-config">Morfana.configure({strokeWidth: 3, zeroEndingWidthFactor: 0.53});</script>
<script type="text/javascript">Morfana.draw();</script>
<style>
body
Expand Down

0 comments on commit 4ff8139

Please sign in to comment.