Visual Console Refactor: error fixes

Former-commit-id: 6b2d7cfb554e72223b101e2d3530c7dbe4acd69a
This commit is contained in:
Alejandro Gallardo Escobar 2019-04-08 16:37:29 +02:00
parent f79af1c70e
commit db7eda7d3e
1 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ export function linePropsDecoder(data: UnknownObject): LineProps | never {
x: parseIntOr(data.endX, 0), x: parseIntOr(data.endX, 0),
y: parseIntOr(data.endY, 0) y: parseIntOr(data.endY, 0)
}, },
lineWidth: parseIntOr(data.lineWidth, 0), lineWidth: parseIntOr(data.lineWidth, 1),
color: notEmptyStringOr(data.color, null) color: notEmptyStringOr(data.color, null)
}; };
} }
@ -82,8 +82,8 @@ export default class Line extends Item<LineProps> {
// SVG container. // SVG container.
const svg = document.createElementNS(svgNS, "svg"); const svg = document.createElementNS(svgNS, "svg");
// Set SVG size. // Set SVG size.
// svg.setAttribute("width", this.props.width.toString()); svg.setAttribute("width", this.props.width.toString());
// svg.setAttribute("height", this.props.height.toString()); svg.setAttribute("height", this.props.height.toString());
const line = document.createElementNS(svgNS, "line"); const line = document.createElementNS(svgNS, "line");
line.setAttribute("x1", `${this.props.startPosition.x - this.props.x}`); line.setAttribute("x1", `${this.props.startPosition.x - this.props.x}`);
line.setAttribute("y1", `${this.props.startPosition.y - this.props.y}`); line.setAttribute("y1", `${this.props.startPosition.y - this.props.y}`);