adjusted zoom to fit ratio
This commit is contained in:
parent
106707d6b2
commit
f53a82f594
23
Layout.md
Normal file
23
Layout.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Overlay > Info Box
|
||||||
|
|
||||||
|
Each toolbar gives itself a header tool which expands/collapses the toolbar.
|
||||||
|
|
||||||
|
- Toolbar Group: Left Side
|
||||||
|
- Toolbar: Tools
|
||||||
|
- Tool: Zoom
|
||||||
|
- Toolbar: Modes
|
||||||
|
- Tool: Mode Switch
|
||||||
|
- Toolbar: Utils
|
||||||
|
- Tool: Utility Tool
|
||||||
|
- Toolbar Group: Right Side
|
||||||
|
- Toolbar: Options
|
||||||
|
- Tool: Options Tool
|
||||||
|
- Section: Pause During
|
||||||
|
- Section: Display
|
||||||
|
- Section: Collision
|
||||||
|
- Toolbar: Params
|
||||||
|
- Tool: Options Tool
|
||||||
|
- Section: Param
|
||||||
|
- Toolbar: Debug
|
||||||
|
- Tool: Options Tool
|
||||||
|
- Section: Debug
|
||||||
@ -60,9 +60,8 @@ export class Zoom extends Tool {
|
|||||||
const y = (box.start.y + box.end.y) / 2;
|
const y = (box.start.y + box.end.y) / 2;
|
||||||
const widthRatio = Math.abs(box.start.x - box.end.x) / this.sim.display.width;
|
const widthRatio = Math.abs(box.start.x - box.end.x) / this.sim.display.width;
|
||||||
const heightRatio = Math.abs(box.start.y - box.end.y) / this.sim.display.height;
|
const heightRatio = Math.abs(box.start.y - box.end.y) / this.sim.display.height;
|
||||||
const biggerRatio = Math.max(widthRatio, heightRatio);
|
const ratio = Math.max(widthRatio, heightRatio) * 2.5;
|
||||||
const base2factor = Math.log2(1 / biggerRatio) - 1;
|
const factor = Math.ceil(Math.log2(1 / ratio));
|
||||||
const factor = Math.ceil(base2factor);
|
|
||||||
|
|
||||||
// Determine average momentum and set panning velocity to match
|
// Determine average momentum and set panning velocity to match
|
||||||
const { netMomentum, totalMass } = this.sim.system.computeSystemCenter();
|
const { netMomentum, totalMass } = this.sim.system.computeSystemCenter();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user