homotopy-rs icon indicating copy to clipboard operation
homotopy-rs copied to clipboard

Reset view should make the diagram fill the screen

Open jamievicary opened this issue 4 years ago • 3 comments
trafficstars

or maybe 80% of the screen (Nick's suggestion) leaving a nice border.

jamievicary avatar Jul 29 '21 11:07 jamievicary

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.

zrho avatar Dec 21 '21 23:12 zrho

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.

cofibrant avatar Dec 22 '21 12:12 cofibrant

https://github.com/homotopy-io/homotopy-rs/blob/c0327a176bf41db81a18475f47962446581c7e3d/homotopy-web/src/model/proof.rs#L229

cofibrant avatar Dec 22 '21 12:12 cofibrant