summaryrefslogtreecommitdiff
path: root/frontend/src/components/app/map/layers
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/app/map/layers')
-rw-r--r--frontend/src/components/app/map/layers/HoverLayerComponent.js34
-rw-r--r--frontend/src/components/app/map/layers/MapLayerComponent.js13
-rw-r--r--frontend/src/components/app/map/layers/ObjectHoverLayerComponent.js2
-rw-r--r--frontend/src/components/app/map/layers/RoomHoverLayerComponent.js2
4 files changed, 18 insertions, 33 deletions
diff --git a/frontend/src/components/app/map/layers/HoverLayerComponent.js b/frontend/src/components/app/map/layers/HoverLayerComponent.js
index 25c9c412..bead87de 100644
--- a/frontend/src/components/app/map/layers/HoverLayerComponent.js
+++ b/frontend/src/components/app/map/layers/HoverLayerComponent.js
@@ -26,18 +26,13 @@ class HoverLayerComponent extends React.Component {
}
const positionX = Math.floor(
- (this.props.mouseX - this.props.mapPosition.x) /
- (this.props.mapScale * TILE_SIZE_IN_PIXELS),
+ (this.props.mouseX - this.props.mapPosition.x) / (this.props.mapScale * TILE_SIZE_IN_PIXELS)
)
const positionY = Math.floor(
- (this.props.mouseY - this.props.mapPosition.y) /
- (this.props.mapScale * TILE_SIZE_IN_PIXELS),
+ (this.props.mouseY - this.props.mapPosition.y) / (this.props.mapScale * TILE_SIZE_IN_PIXELS)
)
- if (
- positionX !== this.state.positionX ||
- positionY !== this.state.positionY
- ) {
+ if (positionX !== this.state.positionX || positionY !== this.state.positionY) {
this.setState({
positionX,
positionY,
@@ -48,15 +43,11 @@ class HoverLayerComponent extends React.Component {
render() {
if (!this.props.isEnabled()) {
- return <Layer/>
+ return <Layer />
}
- const pixelX =
- this.props.mapScale * this.state.positionX * TILE_SIZE_IN_PIXELS +
- this.props.mapPosition.x
- const pixelY =
- this.props.mapScale * this.state.positionY * TILE_SIZE_IN_PIXELS +
- this.props.mapPosition.y
+ const pixelX = this.props.mapScale * this.state.positionX * TILE_SIZE_IN_PIXELS + this.props.mapPosition.x
+ const pixelY = this.props.mapScale * this.state.positionY * TILE_SIZE_IN_PIXELS + this.props.mapPosition.y
return (
<Layer opacity={0.6}>
@@ -66,16 +57,15 @@ class HoverLayerComponent extends React.Component {
scale={this.props.mapScale}
isValid={this.state.validity}
onClick={() =>
- this.state.validity
- ? this.props.onClick(this.state.positionX, this.state.positionY)
- : undefined}
+ this.state.validity ? this.props.onClick(this.state.positionX, this.state.positionY) : undefined
+ }
/>
{this.props.children
? React.cloneElement(this.props.children, {
- pixelX,
- pixelY,
- scale: this.props.mapScale,
- })
+ pixelX,
+ pixelY,
+ scale: this.props.mapScale,
+ })
: undefined}
</Layer>
)
diff --git a/frontend/src/components/app/map/layers/MapLayerComponent.js b/frontend/src/components/app/map/layers/MapLayerComponent.js
index 940057f9..8ee14c9c 100644
--- a/frontend/src/components/app/map/layers/MapLayerComponent.js
+++ b/frontend/src/components/app/map/layers/MapLayerComponent.js
@@ -6,15 +6,10 @@ import GridGroup from '../groups/GridGroup'
const MapLayerComponent = ({ mapPosition, mapScale }) => (
<Layer>
- <Group
- x={mapPosition.x}
- y={mapPosition.y}
- scaleX={mapScale}
- scaleY={mapScale}
- >
- <Backdrop/>
- <TopologyContainer/>
- <GridGroup/>
+ <Group x={mapPosition.x} y={mapPosition.y} scaleX={mapScale} scaleY={mapScale}>
+ <Backdrop />
+ <TopologyContainer />
+ <GridGroup />
</Group>
</Layer>
)
diff --git a/frontend/src/components/app/map/layers/ObjectHoverLayerComponent.js b/frontend/src/components/app/map/layers/ObjectHoverLayerComponent.js
index 31689635..661fc255 100644
--- a/frontend/src/components/app/map/layers/ObjectHoverLayerComponent.js
+++ b/frontend/src/components/app/map/layers/ObjectHoverLayerComponent.js
@@ -2,7 +2,7 @@ import React from 'react'
import TilePlusIcon from '../elements/TilePlusIcon'
import HoverLayerComponent from './HoverLayerComponent'
-const ObjectHoverLayerComponent = props => (
+const ObjectHoverLayerComponent = (props) => (
<HoverLayerComponent {...props}>
<TilePlusIcon {...props} />
</HoverLayerComponent>
diff --git a/frontend/src/components/app/map/layers/RoomHoverLayerComponent.js b/frontend/src/components/app/map/layers/RoomHoverLayerComponent.js
index d3d5e9b2..887e2891 100644
--- a/frontend/src/components/app/map/layers/RoomHoverLayerComponent.js
+++ b/frontend/src/components/app/map/layers/RoomHoverLayerComponent.js
@@ -1,6 +1,6 @@
import React from 'react'
import HoverLayerComponent from './HoverLayerComponent'
-const RoomHoverLayerComponent = props => <HoverLayerComponent {...props} />
+const RoomHoverLayerComponent = (props) => <HoverLayerComponent {...props} />
export default RoomHoverLayerComponent