fix zoom buttons
This commit is contained in:
parent
b5490b6857
commit
035b98afbc
1 changed files with 6 additions and 5 deletions
|
@ -2,7 +2,7 @@ import { ZoomInIcon, ZoomOutIcon } from '@radix-ui/react-icons'
|
||||||
import { IconButton } from 'components/shared'
|
import { IconButton } from 'components/shared'
|
||||||
import state, { useSelector } from 'state'
|
import state, { useSelector } from 'state'
|
||||||
import styled from 'styles'
|
import styled from 'styles'
|
||||||
import { getCurrentCamera } from 'utils/utils'
|
import { getCurrentCamera } from 'utils'
|
||||||
import Tooltip from '../tooltip'
|
import Tooltip from '../tooltip'
|
||||||
|
|
||||||
const zoomIn = () => state.send('ZOOMED_IN')
|
const zoomIn = () => state.send('ZOOMED_IN')
|
||||||
|
@ -34,7 +34,11 @@ function ZoomCounter() {
|
||||||
const zoom = useSelector((s) => getCurrentCamera(s.data).zoom)
|
const zoom = useSelector((s) => getCurrentCamera(s.data).zoom)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ZoomButton onClick={zoomToActual} onDoubleClick={zoomToFit}>
|
<ZoomButton
|
||||||
|
onClick={zoomToActual}
|
||||||
|
onDoubleClick={zoomToFit}
|
||||||
|
style={{ width: '44px' }}
|
||||||
|
>
|
||||||
{Math.round(zoom * 100)}%
|
{Math.round(zoom * 100)}%
|
||||||
</ZoomButton>
|
</ZoomButton>
|
||||||
)
|
)
|
||||||
|
@ -73,9 +77,6 @@ const Container = styled('div', {
|
||||||
bottom: 12,
|
bottom: 12,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
[`& ${ZoomButton}`]: {
|
|
||||||
width: 44,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue