@@ -125,13 +125,7 @@ export class CodeCell extends Disposable {
125125
126126 this . viewCell . editorHeight = e . contentHeight ;
127127
128- if ( this . viewCell . outputs . length ) {
129- let outputHeight = this . viewCell . getOutputTotalHeight ( ) ;
130- notebookEditor . layoutNotebookCell ( this . viewCell , viewCell . editorHeight + EDITOR_TOP_PADDING + EDITOR_BOTTOM_PADDING + 16 /** padding between input and output */ + outputHeight ) ;
131- } else {
132- notebookEditor . layoutNotebookCell ( this . viewCell , viewCell . editorHeight + EDITOR_TOP_PADDING + EDITOR_BOTTOM_PADDING ) ;
133- }
134-
128+ notebookEditor . layoutNotebookCell ( this . viewCell , viewCell . getCellTotalHeight ( ) ) ;
135129 }
136130
137131 }
@@ -198,8 +192,7 @@ export class CodeCell extends Disposable {
198192
199193 let editorHeight = templateData . editor ! . getContentHeight ( ) ;
200194 viewCell . editorHeight = editorHeight ;
201- let totalOutputHeight = viewCell . getOutputTotalHeight ( ) ;
202- notebookEditor . layoutNotebookCell ( viewCell , viewCell . editorHeight + 32 + totalOutputHeight ) ;
195+ notebookEditor . layoutNotebookCell ( viewCell , viewCell . getCellTotalHeight ( ) ) ;
203196 } ) ) ;
204197
205198 if ( viewCell . outputs . length > 0 ) {
@@ -213,9 +206,8 @@ export class CodeCell extends Disposable {
213206 this . renderOutput ( currOutput , index , undefined ) ;
214207 }
215208
216- let totalOutputHeight = viewCell . getOutputTotalHeight ( ) ;
217209 viewCell . editorHeight = totalHeight ;
218- this . notebookEditor . layoutNotebookCell ( viewCell , viewCell . editorHeight + 32 + totalOutputHeight ) ;
210+ this . notebookEditor . layoutNotebookCell ( viewCell , viewCell . getCellTotalHeight ( ) ) ;
219211 } else {
220212 // noop
221213 this . templateData . outputContainer ! . style . display = 'none' ;
@@ -302,9 +294,7 @@ export class CodeCell extends Disposable {
302294 }
303295
304296 this . viewCell . updateOutputHeight ( currIndex , height ) ;
305- const editorHeight = this . viewCell . editorHeight ;
306- const totalOutputHeight = this . viewCell . getOutputTotalHeight ( ) ;
307- this . notebookEditor . layoutNotebookCell ( this . viewCell , editorHeight + 32 + totalOutputHeight ) ;
297+ this . notebookEditor . layoutNotebookCell ( this . viewCell , this . viewCell . getCellTotalHeight ( ) ) ;
308298 }
309299 } ) ;
310300 elementSizeObserver . startObserving ( ) ;
@@ -382,9 +372,7 @@ export class CodeCell extends Disposable {
382372 output . pickedMimeTypeIndex = pick ;
383373
384374 this . renderOutput ( output , index , nextElement ) ;
385-
386- let totalOutputHeight = this . viewCell . getOutputTotalHeight ( ) ;
387- this . notebookEditor . layoutNotebookCell ( this . viewCell , this . viewCell . editorHeight + 32 + totalOutputHeight ) ;
375+ this . notebookEditor . layoutNotebookCell ( this . viewCell , this . viewCell . getCellTotalHeight ( ) ) ;
388376 }
389377 }
390378
0 commit comments