improve zoom
This commit is contained in:
parent
6bbb230636
commit
7c66cc1878
1 changed files with 6 additions and 5 deletions
|
|
@ -136,10 +136,10 @@ export function TopPanel({rt, rtIdx, time, setTime, onUndo, onRedo, onInit, onCl
|
||||||
}, [time]);
|
}, [time]);
|
||||||
|
|
||||||
function onZoomIn() {
|
function onZoomIn() {
|
||||||
setZoom(zoom => Math.min(zoom * 1.25, 4));
|
setZoom(zoom => Math.min(zoom * 1.25, (1.25)**6));
|
||||||
}
|
}
|
||||||
function onZoomOut() {
|
function onZoomOut() {
|
||||||
setZoom(zoom => Math.max(zoom / 1.25, 1/4));
|
setZoom(zoom => Math.max(zoom / 1.25, (1/1.25)**6));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onChangePaused(paused: boolean, wallclktime: number) {
|
function onChangePaused(paused: boolean, wallclktime: number) {
|
||||||
|
|
@ -210,12 +210,13 @@ export function TopPanel({rt, rtIdx, time, setTime, onUndo, onRedo, onInit, onCl
|
||||||
|
|
||||||
{/* zoom */}
|
{/* zoom */}
|
||||||
<div className="toolbarGroup">
|
<div className="toolbarGroup">
|
||||||
<KeyInfo keyInfo={<><kbd>Ctrl</kbd>+<kbd>+</kbd></>}>
|
|
||||||
<button title="zoom in" onClick={onZoomIn}><ZoomInIcon fontSize="small"/></button>
|
|
||||||
</KeyInfo>
|
|
||||||
<KeyInfo keyInfo={<><kbd>Ctrl</kbd>+<kbd>-</kbd></>}>
|
<KeyInfo keyInfo={<><kbd>Ctrl</kbd>+<kbd>-</kbd></>}>
|
||||||
<button title="zoom out" onClick={onZoomOut}><ZoomOutIcon fontSize="small"/></button>
|
<button title="zoom out" onClick={onZoomOut}><ZoomOutIcon fontSize="small"/></button>
|
||||||
</KeyInfo>
|
</KeyInfo>
|
||||||
|
<input title="current zoom level" value={zoom.toFixed(3)} style={{width:40}} readOnly/>
|
||||||
|
<KeyInfo keyInfo={<><kbd>Ctrl</kbd>+<kbd>+</kbd></>}>
|
||||||
|
<button title="zoom in" onClick={onZoomIn}><ZoomInIcon fontSize="small"/></button>
|
||||||
|
</KeyInfo>
|
||||||
 
|
 
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue