mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-04 02:34:13 +02:00
viewer: initial center
This commit is contained in:
parent
f5f553c446
commit
be6ff11093
3 changed files with 10 additions and 11 deletions
|
|
@ -13,10 +13,6 @@ export interface PannerProps {
|
|||
}
|
||||
|
||||
export const Panner = (props: ParentProps<PannerProps>) => {
|
||||
const [scale, setScale] = createSignal(0);
|
||||
const [translateX, setTranslateX] = createSignal(0);
|
||||
const [translateY, setTranslateY] = createSignal(0);
|
||||
|
||||
const panner = new CenteredPanZoom({
|
||||
screenHeight: props.height,
|
||||
screenWidth: props.width,
|
||||
|
|
@ -24,6 +20,10 @@ export const Panner = (props: ParentProps<PannerProps>) => {
|
|||
contentSize: props.contentSize
|
||||
});
|
||||
|
||||
const [scale, setScale] = createSignal(props.scale);
|
||||
const [translateX, setTranslateX] = createSignal(Math.floor(panner.viewport.x));
|
||||
const [translateY, setTranslateY] = createSignal(Math.floor(panner.viewport.y));
|
||||
|
||||
let startX = 0;
|
||||
let startY = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue