Added measure tool
This commit is contained in:
@@ -7,6 +7,7 @@ import MapDrawing from "./MapDrawing";
|
||||
import MapFog from "./MapFog";
|
||||
import MapDice from "./MapDice";
|
||||
import MapGrid from "./MapGrid";
|
||||
import MapMeasure from "./MapMeasure";
|
||||
|
||||
import TokenDataContext from "../../contexts/TokenDataContext";
|
||||
import MapLoadingContext from "../../contexts/MapLoadingContext";
|
||||
@@ -53,6 +54,9 @@ function Map({
|
||||
type: "brush",
|
||||
useBlending: true,
|
||||
},
|
||||
measure: {
|
||||
type: "chebyshev",
|
||||
},
|
||||
});
|
||||
|
||||
function handleToolSettingChange(tool, change) {
|
||||
@@ -134,6 +138,7 @@ function Map({
|
||||
}
|
||||
if (!map) {
|
||||
disabledControls.push("pan");
|
||||
disabledControls.push("measure");
|
||||
}
|
||||
if (!allowFogDrawing) {
|
||||
disabledControls.push("fog");
|
||||
@@ -277,6 +282,14 @@ function Map({
|
||||
<MapGrid map={map} gridSize={gridSizeNormalized} />
|
||||
);
|
||||
|
||||
const mapMeasure = (
|
||||
<MapMeasure
|
||||
active={selectedToolId === "measure"}
|
||||
gridSize={gridSizeNormalized}
|
||||
selectedToolSettings={toolSettings[selectedToolId]}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<MapInteraction
|
||||
map={map}
|
||||
@@ -296,6 +309,7 @@ function Map({
|
||||
{mapDrawing}
|
||||
{mapTokens}
|
||||
{mapFog}
|
||||
{mapMeasure}
|
||||
</MapInteraction>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user