Changed grid overlay to use repeating images instead of shapes

This commit is contained in:
Mitchell McCaffrey
2021-02-09 16:58:14 +11:00
parent 663e1af4d9
commit 2d5589a02e
7 changed files with 56 additions and 123 deletions

View File

@@ -135,7 +135,7 @@ function MapEditor({ map, onSettingsChange }) {
width={mapWidth}
height={mapHeight}
>
<MapGrid map={map} strokeWidth={0.5} />
<MapGrid map={map} />
<MapGridEditor map={map} onGridChange={handleGridChange} />
</GridProvider>
)}

View File

@@ -8,7 +8,7 @@ import { getImageLightness } from "../../helpers/image";
import Grid from "../Grid";
function MapGrid({ map, strokeWidth }) {
function MapGrid({ map }) {
let mapSourceMap = map;
// Use lowest resolution for grid lightness
if (map && map.type === "file" && map.resolutions) {
@@ -29,13 +29,7 @@ function MapGrid({ map, strokeWidth }) {
}
}, [mapImage, mapLoadingStatus]);
return (
<Grid strokeWidth={strokeWidth} stroke={isImageLight ? "black" : "white"} />
);
return <Grid stroke={isImageLight ? "black" : "white"} />;
}
MapGrid.defaultProps = {
strokeWidth: 0.1,
};
export default MapGrid;