File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ class CustomFlyout extends Blockly.VerticalFlyout {
4545 return ;
4646 }
4747
48+ this . height_ = this . getHeight ( ) ;
49+
4850 const edgeWidth = this . width_ - this . CORNER_RADIUS ;
4951 const edgeHeight = this . height_ - 2 * this . CORNER_RADIUS ;
5052
@@ -55,6 +57,21 @@ class CustomFlyout extends Blockly.VerticalFlyout {
5557
5658 this . positionAt_ ( this . width_ , this . height_ , x , y ) ;
5759 }
60+ protected getHeight ( ) : number {
61+ let flydownWorkspace = this . getWorkspace ( ) ;
62+ if ( ! flydownWorkspace ) {
63+ return 0 ;
64+ }
65+ const blocks = flydownWorkspace . getAllBlocks ( ) ;
66+ let height = 0 ;
67+ blocks . forEach ( ( block : Blockly . BlockSvg ) => {
68+ const blockHeight = block . getHeightWidth ( ) . height ;
69+ height += blockHeight + this . GAP_Y ; // Add some padding between blocks
70+ } ) ;
71+
72+ return height ;
73+ }
74+
5875
5976 /**
6077 * Create and set the path for the visible boundaries of the flyout.
You can’t perform that action at this time.
0 commit comments