diff options
author | emkael <emkael@tlen.pl> | 2017-08-08 14:31:31 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-08-08 14:34:07 +0200 |
commit | 86654dee683d9a2cda00a528b006433cebeebf26 (patch) | |
tree | d728c6bee12369c9d51acb20f927cd222315681b | |
parent | 07396b68393acdacceb59f825d570d742a7f95cd (diff) |
Parsing canvas lines offsets as numeric values
Fixes #1
-rw-r--r-- | playoff.js | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -61,9 +61,9 @@ var playoff = { var box = boxes_idx[from[f]]; var line = [ Math.floor(parseInt(box.style.left) + parseInt(box.clientWidth)), - Math.floor(parseInt(box.style.top) + 0.5 * parseInt(box.clientHeight) + this.settings[type + '_v_offset']), - Math.floor(parseInt(box.style.left) + parseInt(box.clientWidth) + this.settings[type + '_h_offset']), - Math.floor(parseInt(box.style.top) + 0.5 * parseInt(box.clientHeight) + this.settings[type + '_v_offset']) + Math.floor(parseInt(box.style.top) + 0.5 * parseInt(box.clientHeight) + parseFloat(this.settings[type + '_v_offset'])), + Math.floor(parseInt(box.style.left) + parseInt(box.clientWidth) + parseFloat(this.settings[type + '_h_offset'])), + Math.floor(parseInt(box.style.top) + 0.5 * parseInt(box.clientHeight) + parseFloat(this.settings[type + '_v_offset'])) ]; horizontal_from.push(line); for (var l in horizontal_from) { @@ -90,9 +90,9 @@ var playoff = { var box = boxes_idx[to[t]]; var line = [ parseInt(box.style.left), - Math.floor(parseInt(box.style.top) + 0.5 * parseInt(box.clientHeight) + this.settings[type + '_v_offset']), - Math.floor(parseInt(box.style.left) - this.settings[type + '_h_offset']), - Math.floor(parseInt(box.style.top) + 0.5 * parseInt(box.clientHeight) + this.settings[type + '_v_offset']) + Math.floor(parseInt(box.style.top) + 0.5 * parseInt(box.clientHeight) + parseFloat(this.settings[type + '_v_offset'])), + Math.floor(parseInt(box.style.left) - parseFloat(this.settings[type + '_h_offset'])), + Math.floor(parseInt(box.style.top) + 0.5 * parseInt(box.clientHeight) + parseFloat(this.settings[type + '_v_offset'])) ]; horizontal_to.push(line); for (var l in horizontal_to) { @@ -119,11 +119,11 @@ var playoff = { (vertical_from[1] + vertical_from[3]) / 2 ], [ - this.settings[type + '_h_offset'] / 2 + (vertical_from[0] + vertical_from[2] + vertical_to[0] + vertical_to[2]) / 4, + parseFloat(this.settings[type + '_h_offset']) / 2 + (vertical_from[0] + vertical_from[2] + vertical_to[0] + vertical_to[2]) / 4, (vertical_from[1] + vertical_from[3]) / 2 ], [ - this.settings[type + '_h_offset'] / 2 + (vertical_from[0] + vertical_from[2] + vertical_to[0] + vertical_to[2]) / 4, + parseFloat((this.settings[type + '_h_offset']) / 2 + (vertical_from[0] + vertical_from[2] + vertical_to[0] + vertical_to[2]) / 4, (vertical_to[1] + vertical_to[3]) / 2 ], [ |