kopia lustrzana https://github.com/Tldraw/Tldraw
Simplify
rodzic
4c5abe888c
commit
0810f33985
|
@ -186,22 +186,8 @@ export class MinimapManager {
|
||||||
const ly = Math.max(0, minY + vpPageBounds.height - py)
|
const ly = Math.max(0, minY + vpPageBounds.height - py)
|
||||||
const ry = Math.max(0, -(maxY - vpPageBounds.height - py))
|
const ry = Math.max(0, -(maxY - vpPageBounds.height - py))
|
||||||
|
|
||||||
const ql = Math.max(0, lx - rx)
|
px += (lx - rx) / 2
|
||||||
const qr = Math.max(0, rx - lx)
|
py += (ly - ry) / 2
|
||||||
const qt = Math.max(0, ly - ry)
|
|
||||||
const qb = Math.max(0, ry - ly)
|
|
||||||
|
|
||||||
if (ql && ql > qr) {
|
|
||||||
px += ql / 2
|
|
||||||
} else if (qr) {
|
|
||||||
px -= qr / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qt && qt > qb) {
|
|
||||||
py += qt / 2
|
|
||||||
} else if (qb) {
|
|
||||||
py -= qb / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
px = clamp(px, minX, maxX)
|
px = clamp(px, minX, maxX)
|
||||||
py = clamp(py, minY, maxY)
|
py = clamp(py, minY, maxY)
|
||||||
|
|
Ładowanie…
Reference in New Issue