fix phone zoom

This commit is contained in:
HF 2024-01-22 00:06:29 +01:00
parent 958ca1e1b7
commit eb6c1772db

View File

@ -9,7 +9,6 @@
import {
setHover,
unsetHover,
setScale,
selectColor,
} from '../store/actions';
import pixelTransferController from '../ui/PixelTransferController';
@ -341,12 +340,13 @@ class PixelPainterControls {
const a = event.touches[0];
const b = event.touches[1];
const { tapStartDist, tapStartView } = this;
const { tapStartDist } = this;
const dist = Math.sqrt(
(b.pageX - a.pageX) ** 2 + (b.pageY - a.pageY) ** 2,
);
const pinchScale = dist / tapStartDist;
this.store.dispatch(setScale(tapStartView[2] * pinchScale));
const [x, y] = this.renderer.view;
this.renderer.updateView([x, y, clickTapStartView[2] * pinchScale]);
}
}
}