2020-04-27 17:29:46 +10:00
|
|
|
import React from "react";
|
|
|
|
|
import { Flex } from "theme-ui";
|
|
|
|
|
|
|
|
|
|
import EdgeSnappingToggle from "./EdgeSnappingToggle";
|
|
|
|
|
import RadioIconButton from "./RadioIconButton";
|
|
|
|
|
|
2020-06-19 18:04:58 +10:00
|
|
|
import FogBrushIcon from "../../../icons/FogBrushIcon";
|
|
|
|
|
import FogPolygonIcon from "../../../icons/FogPolygonIcon";
|
2020-04-27 17:29:46 +10:00
|
|
|
import FogRemoveIcon from "../../../icons/FogRemoveIcon";
|
|
|
|
|
import FogToggleIcon from "../../../icons/FogToggleIcon";
|
2020-06-21 13:18:03 +10:00
|
|
|
import FogAddIcon from "../../../icons/FogAddIcon";
|
|
|
|
|
import FogSubtractIcon from "../../../icons/FogSubtractIcon";
|
2020-04-27 17:29:46 +10:00
|
|
|
|
2020-04-30 09:29:16 +10:00
|
|
|
import UndoButton from "./UndoButton";
|
|
|
|
|
import RedoButton from "./RedoButton";
|
|
|
|
|
|
2020-05-26 14:47:37 +10:00
|
|
|
import Divider from "../../Divider";
|
2020-04-27 17:29:46 +10:00
|
|
|
|
2020-04-30 09:29:16 +10:00
|
|
|
function BrushToolSettings({
|
|
|
|
|
settings,
|
|
|
|
|
onSettingChange,
|
|
|
|
|
onToolAction,
|
|
|
|
|
disabledActions,
|
|
|
|
|
}) {
|
2020-04-27 17:29:46 +10:00
|
|
|
return (
|
|
|
|
|
<Flex sx={{ alignItems: "center" }}>
|
|
|
|
|
<RadioIconButton
|
2020-06-19 18:04:58 +10:00
|
|
|
title="Fog Polygon"
|
|
|
|
|
onClick={() => onSettingChange({ type: "polygon" })}
|
|
|
|
|
isSelected={settings.type === "polygon"}
|
2020-04-27 17:29:46 +10:00
|
|
|
>
|
2020-06-19 18:04:58 +10:00
|
|
|
<FogPolygonIcon />
|
2020-04-27 17:29:46 +10:00
|
|
|
</RadioIconButton>
|
2020-06-09 12:45:52 +10:00
|
|
|
<RadioIconButton
|
2020-06-19 18:04:58 +10:00
|
|
|
title="Fog Brush"
|
|
|
|
|
onClick={() => onSettingChange({ type: "brush" })}
|
|
|
|
|
isSelected={settings.type === "brush"}
|
2020-06-09 12:45:52 +10:00
|
|
|
>
|
2020-06-19 18:04:58 +10:00
|
|
|
<FogBrushIcon />
|
2020-04-27 17:29:46 +10:00
|
|
|
</RadioIconButton>
|
2020-06-19 18:04:58 +10:00
|
|
|
<Divider vertical />
|
2020-06-21 14:55:17 +10:00
|
|
|
<RadioIconButton
|
|
|
|
|
title="Toggle Fog"
|
|
|
|
|
onClick={() => onSettingChange({ type: "toggle" })}
|
|
|
|
|
isSelected={settings.type === "toggle"}
|
|
|
|
|
>
|
|
|
|
|
<FogToggleIcon />
|
|
|
|
|
</RadioIconButton>
|
|
|
|
|
<RadioIconButton
|
|
|
|
|
title="Remove Fog"
|
|
|
|
|
onClick={() => onSettingChange({ type: "remove" })}
|
|
|
|
|
isSelected={settings.type === "remove"}
|
|
|
|
|
>
|
|
|
|
|
<FogRemoveIcon />
|
|
|
|
|
</RadioIconButton>
|
|
|
|
|
<Divider vertical />
|
2020-06-21 13:18:03 +10:00
|
|
|
<RadioIconButton
|
|
|
|
|
title="Add Fog"
|
|
|
|
|
onClick={() => onSettingChange({ useFogSubtract: false })}
|
|
|
|
|
isSelected={!settings.useFogSubtract}
|
|
|
|
|
>
|
|
|
|
|
<FogAddIcon />
|
|
|
|
|
</RadioIconButton>
|
|
|
|
|
<RadioIconButton
|
|
|
|
|
title="Subtract Fog"
|
|
|
|
|
onClick={() => onSettingChange({ useFogSubtract: true })}
|
|
|
|
|
isSelected={settings.useFogSubtract}
|
|
|
|
|
>
|
|
|
|
|
<FogSubtractIcon />
|
|
|
|
|
</RadioIconButton>
|
2020-06-21 14:55:17 +10:00
|
|
|
<Divider vertical />
|
|
|
|
|
<EdgeSnappingToggle
|
2020-06-19 18:04:58 +10:00
|
|
|
useEdgeSnapping={settings.useEdgeSnapping}
|
|
|
|
|
onEdgeSnappingChange={(useEdgeSnapping) =>
|
|
|
|
|
onSettingChange({ useEdgeSnapping })
|
|
|
|
|
}
|
2020-06-21 14:55:17 +10:00
|
|
|
/>
|
2020-04-30 09:29:16 +10:00
|
|
|
<Divider vertical />
|
|
|
|
|
<UndoButton
|
|
|
|
|
onClick={() => onToolAction("fogUndo")}
|
|
|
|
|
disabled={disabledActions.includes("undo")}
|
|
|
|
|
/>
|
|
|
|
|
<RedoButton
|
|
|
|
|
onClick={() => onToolAction("fogRedo")}
|
|
|
|
|
disabled={disabledActions.includes("redo")}
|
|
|
|
|
/>
|
2020-04-27 17:29:46 +10:00
|
|
|
</Flex>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default BrushToolSettings;
|