homotopy-rs
homotopy-rs copied to clipboard
Reset view should make the diagram fill the screen
or maybe 80% of the screen (Nick's suggestion) leaving a nice border.
We probably don't always want this: when we click on a diagram to attach a cell, its probably undesirable to reset pan and zoom.
Currently we just keep the positioning the same, which works well when attaching to the target border since attaching multiple cells is just a couple of clicks at the same position. Ideally the new diagram after an attachment would be positioned such that the attachment at the same boundary can be repeated by clicking again.
Contraction and expansion would be borderline unusable if the view reset naively.
View is only reset for actions for which it makes sense to reset the view. This issue is referring to the zoom level after the view is reset. In particular, at present, the zoom is always set to 1.0 after a reset. This issue suggests computing the maximum scale factor such that the entire diagram would be visible and using this instead.
https://github.com/homotopy-io/homotopy-rs/blob/c0327a176bf41db81a18475f47962446581c7e3d/homotopy-web/src/model/proof.rs#L229