mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
<path> error fix & literals (#1993)
This commit is contained in:
parent
cf19ceb193
commit
856ef34964
@ -140,7 +140,6 @@ class HuiSensorCard extends EventsMixin(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getPath(points) {
|
_getPath(points) {
|
||||||
const SPACE = " ";
|
|
||||||
let next;
|
let next;
|
||||||
let Z;
|
let Z;
|
||||||
const X = 0;
|
const X = 0;
|
||||||
@ -148,20 +147,17 @@ class HuiSensorCard extends EventsMixin(LitElement) {
|
|||||||
let path = "";
|
let path = "";
|
||||||
let point = points[0];
|
let point = points[0];
|
||||||
|
|
||||||
path += "M" + point[X] + "," + point[Y];
|
path += `M ${point[X]},${point[Y]}`;
|
||||||
const first = point;
|
|
||||||
|
|
||||||
for (let i = 0; i < points.length; i++) {
|
for (let i = 0; i < points.length; i++) {
|
||||||
next = points[i];
|
next = points[i];
|
||||||
Z = this._midPoint(point[X], point[Y], next[X], next[Y]);
|
Z = this._midPoint(point[X], point[Y], next[X], next[Y]);
|
||||||
path += SPACE + Z[X] + "," + Z[Y];
|
path += ` ${Z[X]},${Z[Y]}`;
|
||||||
path += "Q" + Math.floor(next[X]) + "," + next[Y];
|
path += ` Q${next[X]},${next[Y]}`;
|
||||||
point = next;
|
point = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
const second = points[1];
|
path += ` ${next[X]},${next[Y]}`;
|
||||||
Z = this._midPoint(first[X], first[Y], second[X], second[Y]);
|
|
||||||
path += SPACE + Math.floor(next[X]) + "." + points[points.length - 1];
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user