summaryrefslogtreecommitdiff
path: root/frontend/src/components/app/map/elements/WallSegment.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-07-01 13:33:31 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:47:17 +0200
commitde8f12d74faef5fa3f9e38d1340948cab2d06ea3 (patch)
tree678bf1af3e5fa2334f0df43388d45294785bbf1e /frontend/src/components/app/map/elements/WallSegment.js
parent44236756c4cf689806dc17c6950a2cff3e9227bf (diff)
Manually generate IDs
Diffstat (limited to 'frontend/src/components/app/map/elements/WallSegment.js')
-rw-r--r--frontend/src/components/app/map/elements/WallSegment.js66
1 files changed, 33 insertions, 33 deletions
diff --git a/frontend/src/components/app/map/elements/WallSegment.js b/frontend/src/components/app/map/elements/WallSegment.js
index c5011656..d1ba6157 100644
--- a/frontend/src/components/app/map/elements/WallSegment.js
+++ b/frontend/src/components/app/map/elements/WallSegment.js
@@ -1,39 +1,39 @@
-import React from "react";
-import { Line } from "react-konva";
-import Shapes from "../../../../shapes/index";
-import { WALL_COLOR } from "../../../../util/colors";
-import { TILE_SIZE_IN_PIXELS, WALL_WIDTH_IN_PIXELS } from "../MapConstants";
+import React from 'react'
+import { Line } from 'react-konva'
+import Shapes from '../../../../shapes/index'
+import { WALL_COLOR } from '../../../../util/colors'
+import { TILE_SIZE_IN_PIXELS, WALL_WIDTH_IN_PIXELS } from '../MapConstants'
const WallSegment = ({ wallSegment }) => {
- let points;
- if (wallSegment.isHorizontal) {
- points = [
- wallSegment.startPosX * TILE_SIZE_IN_PIXELS,
- wallSegment.startPosY * TILE_SIZE_IN_PIXELS,
- (wallSegment.startPosX + wallSegment.length) * TILE_SIZE_IN_PIXELS,
- wallSegment.startPosY * TILE_SIZE_IN_PIXELS
- ];
- } else {
- points = [
- wallSegment.startPosX * TILE_SIZE_IN_PIXELS,
- wallSegment.startPosY * TILE_SIZE_IN_PIXELS,
- wallSegment.startPosX * TILE_SIZE_IN_PIXELS,
- (wallSegment.startPosY + wallSegment.length) * TILE_SIZE_IN_PIXELS
- ];
- }
+ let points
+ if (wallSegment.isHorizontal) {
+ points = [
+ wallSegment.startPosX * TILE_SIZE_IN_PIXELS,
+ wallSegment.startPosY * TILE_SIZE_IN_PIXELS,
+ (wallSegment.startPosX + wallSegment.length) * TILE_SIZE_IN_PIXELS,
+ wallSegment.startPosY * TILE_SIZE_IN_PIXELS,
+ ]
+ } else {
+ points = [
+ wallSegment.startPosX * TILE_SIZE_IN_PIXELS,
+ wallSegment.startPosY * TILE_SIZE_IN_PIXELS,
+ wallSegment.startPosX * TILE_SIZE_IN_PIXELS,
+ (wallSegment.startPosY + wallSegment.length) * TILE_SIZE_IN_PIXELS,
+ ]
+ }
- return (
- <Line
- points={points}
- lineCap="round"
- stroke={WALL_COLOR}
- strokeWidth={WALL_WIDTH_IN_PIXELS}
- />
- );
-};
+ return (
+ <Line
+ points={points}
+ lineCap="round"
+ stroke={WALL_COLOR}
+ strokeWidth={WALL_WIDTH_IN_PIXELS}
+ />
+ )
+}
WallSegment.propTypes = {
- wallSegment: Shapes.WallSegment
-};
+ wallSegment: Shapes.WallSegment,
+}
-export default WallSegment;
+export default WallSegment