proper zoom level
This commit is contained in:
1 parent
b1c5bce584
commit
93fe26e787
6 files changed
+45
-12
No files matched your search
@@ -13,6 +13,7 @@ import { AutomationTrigger } from 'types/automations/triggers';
|
||||
import { Modal } from "components/Modal";
|
||||
import { NodeEditor } from "components/NodeEditor";
|
||||
import { ButtonIcon } from "components/Icons/ButtonIcons";
|
||||
import InputNumber from "components/Inputs/InputNumber";
|
||||
|
||||
interface TriggerEditorModalState {
|
||||
trigger: AutomationTrigger;
|
||||
@@ -29,6 +30,7 @@ export const AutomationEditor: FC<Props> = ({
|
||||
onUpdate,
|
||||
}) => {
|
||||
// state
|
||||
const [zoomLevel, setZoomLevel] = useState(40);
|
||||
const { ratioWbh } = useWindowSize();
|
||||
const [closeInfo, setCloseInfo] = useState(false);
|
||||
const [modalState, setModalState] = useState<null | TriggerEditorModalState>(null);
|
||||
@@ -49,6 +51,13 @@ export const AutomationEditor: FC<Props> = ({
|
||||
|
||||
// render
|
||||
return <div className={classes.root}>
|
||||
<InputNumber
|
||||
label="Zoom"
|
||||
min={1} max={100} step={1}
|
||||
className={classes.zoom}
|
||||
value={zoomLevel}
|
||||
onChange={z => setZoomLevel(z ?? 40)}
|
||||
/>
|
||||
<Modal open={!!modalState}>
|
||||
{!!modalState && <NodeEditor
|
||||
node={modalState.trigger}
|
||||
@@ -73,7 +82,7 @@ export const AutomationEditor: FC<Props> = ({
|
||||
</AutoInfoBox>
|
||||
|
||||
<SequenceNodes
|
||||
zoomLevel={1.5}
|
||||
zoomLevel={zoomLevel * 200 / 100 + 50}
|
||||
startPoint={[2, 0.5]}
|
||||
dims={dims}
|
||||
sequence={automation.sequence}
|
||||
|
||||
@@ -5,7 +5,7 @@ export const useEditorStyles = createAppUseStyles<{
|
||||
closeInfo: boolean;
|
||||
horizontalMode: boolean;
|
||||
}>(theme => ({
|
||||
root: ({horizontalMode}) => ({
|
||||
root: ({ horizontalMode }) => ({
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
color: theme.primaryAccent,
|
||||
@@ -18,7 +18,14 @@ export const useEditorStyles = createAppUseStyles<{
|
||||
borderColor: theme.secondaryAccent,
|
||||
width: '100%',
|
||||
},
|
||||
infoIcon: ({horizontalMode}) => ({
|
||||
infoIcon: ({ horizontalMode }) => ({
|
||||
bottom: horizontalMode ? '90%' : 10
|
||||
})
|
||||
}),
|
||||
zoom: {
|
||||
position: 'absolute !important',
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
width: "100%",
|
||||
// maxWidth: "10em",
|
||||
}
|
||||
}))
|
||||
Reference in new issue
Block a user