diff --git a/src/components/Match/VisionMap.jsx b/src/components/Match/VisionMap.jsx index 0fbb6ef5c4..b52a7dc8cc 100644 --- a/src/components/Match/VisionMap.jsx +++ b/src/components/Match/VisionMap.jsx @@ -3,7 +3,7 @@ import Checkbox from 'material-ui/Checkbox'; import Visibility from 'material-ui/svg-icons/action/visibility'; import VisibilityOff from 'material-ui/svg-icons/action/visibility-off'; import { - isRadiant, + playerColors, // transformations, } from 'utility'; import Table from 'components/Table'; @@ -20,7 +20,7 @@ import { const obsWard = (style, stroke, iconSize) => ( Observer - + @@ -32,7 +32,7 @@ const obsWard = (style, stroke, iconSize) => ( ( Sentry - + @@ -63,8 +63,9 @@ class VisionMap extends React.Component { const match = this.props.match; const width = this.props.width; const enabledIndex = this.state.enabledIndex; - const iconSize = width / 12; - const style = ward => ({ + const senSize = width / 12; + const obsSize = senSize * (1600 / 850); // 850 radius sentry, 1600 radius observer + const style = (ward, iconSize) => ({ position: 'absolute', top: ((width / 127) * ward.y) - (iconSize / 2), left: ((width / 127) * ward.x) - (iconSize / 2), @@ -76,9 +77,9 @@ class VisionMap extends React.Component { if (match && match.players && match.players[index]) { const obs = (match.players[index].posData && match.players[index].posData.obs) || []; const sen = (match.players[index].posData && match.players[index].posData.sen) || []; - const stroke = isRadiant(match.players[index].player_slot) ? 'green' : 'red'; - obs.forEach(ward => obsIcons.push(obsWard(style(ward), stroke, iconSize))); - sen.forEach(ward => senIcons.push(senWard(style(ward), stroke, iconSize))); + const stroke = playerColors[match.players[index].player_slot]; + obs.forEach(ward => obsIcons.push(obsWard(style(ward, obsSize), stroke, obsSize))); + sen.forEach(ward => senIcons.push(senWard(style(ward, senSize), stroke, senSize))); } } });