Add 'View > Zoom to Selected' action (#1047)

* implements pan/zoom to the selected layer(s) on Period

Relates to #989

* adds layer menu support: Layer -> Center View on Selection

* relocate Center View on Selection to View -> Zoom to selected

* use the proper menu title
This commit is contained in:
Adam Jahn
2023-02-20 20:00:07 -05:00
committed by Keavon Chambers
parent 37775eb9e9
commit 4797aed05b
5 changed files with 29 additions and 4 deletions

View File

@@ -280,6 +280,7 @@ pub fn default_mapping() -> Mapping {
entry!(KeyDown(PageDown); modifiers=[Shift], action_dispatch=NavigationMessage::TranslateCanvasByViewportFraction { delta: DVec2::new(-1., 0.) }),
entry!(KeyDown(PageUp); action_dispatch=NavigationMessage::TranslateCanvasByViewportFraction { delta: DVec2::new(0., 1.) }),
entry!(KeyDown(PageDown); action_dispatch=NavigationMessage::TranslateCanvasByViewportFraction { delta: DVec2::new(0., -1.) }),
entry!(KeyDown(Period); action_dispatch=NavigationMessage::FitViewportToSelection),
//
// PortfolioMessage
entry!(KeyDown(KeyO); modifiers=[Accel], action_dispatch=PortfolioMessage::OpenDocument),