File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ All features can be enabled/disabled in the settings.
6969## Canvas Commands
7070- ` Advanced Canvas: Create text node `
7171 - Create a new text node
72+ - ` Advanced Canvas: Zoom to selection `
73+ - Zoom to the bounding box of the selected nodes
7274- ` Advanced Canvas: Clone node up/down/left/right `
7375 - Clone the selected node in the direction of the arrow keys
7476 - The cloned node will have the same dimensions and color as the original node
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ export interface Canvas {
4545
4646 getViewportBBox ( ) : BBox
4747 zoomToBbox ( bbox : BBox ) : void
48+ zoomToSelection ( ) : void
4849
4950 undo ( ) : void
5051 redo ( ) : void
Original file line number Diff line number Diff line change @@ -29,6 +29,16 @@ export default class CommandsCanvasExtension {
2929 )
3030 } )
3131
32+ this . plugin . addCommand ( {
33+ id : 'zoom-to-selection' ,
34+ name : 'Zoom to selection' ,
35+ checkCallback : CanvasHelper . canvasCommand (
36+ this . plugin ,
37+ ( canvas : Canvas ) => canvas . selection . size > 0 ,
38+ ( canvas : Canvas ) => canvas . zoomToSelection ( )
39+ )
40+ } )
41+
3242 for ( const direction of DRIECTIONS ) {
3343 this . plugin . addCommand ( {
3444 id : `clone-node-${ direction } ` ,
You can’t perform that action at this time.
0 commit comments