summaryrefslogtreecommitdiff
path: root/playoff.js
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-08-08 14:31:31 +0200
committeremkael <emkael@tlen.pl>2017-08-08 14:34:07 +0200
commit86654dee683d9a2cda00a528b006433cebeebf26 (patch)
treed728c6bee12369c9d51acb20f927cd222315681b /playoff.js
parent07396b68393acdacceb59f825d570d742a7f95cd (diff)
Parsing canvas lines offsets as numeric values
Fixes #1
Diffstat (limited to 'playoff.js')
-rw-r--r--playoff.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/playoff.js b/playoff.js
index 1763d59..b2f7a4b 100644
--- a/playoff.js
+++ b/playoff.js
@@ -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
],
[