@@ -14,13 +14,9 @@ import {StatementInput} from '../../inputs/statement_input.js';
1414import { ValueInput } from '../../inputs/value_input.js' ;
1515import { RenderInfo as BaseRenderInfo } from '../common/info.js' ;
1616import type { Measurable } from '../measurables/base.js' ;
17- import type { BottomRow } from '../measurables/bottom_row.js' ;
1817import { ExternalValueInput } from '../measurables/external_value_input.js' ;
19- import type { Field } from '../measurables/field.js' ;
2018import { InRowSpacer } from '../measurables/in_row_spacer.js' ;
21- import type { InputRow } from '../measurables/input_row.js' ;
2219import type { Row } from '../measurables/row.js' ;
23- import type { TopRow } from '../measurables/top_row.js' ;
2420import { Types } from '../measurables/types.js' ;
2521import type { ConstantProvider } from './constants.js' ;
2622import { InlineInput } from './measurables/inline_input.js' ;
@@ -150,7 +146,7 @@ export class RenderInfo extends BaseRenderInfo {
150146 override getInRowSpacing_ ( prev : Measurable | null , next : Measurable | null ) {
151147 if ( ! prev ) {
152148 // Between an editable field and the beginning of the row.
153- if ( next && Types . isField ( next ) && ( next as Field ) . isEditable ) {
149+ if ( next && Types . isField ( next ) && next . isEditable ) {
154150 return this . constants_ . MEDIUM_PADDING ;
155151 }
156152 // Inline input at the beginning of the row.
@@ -167,7 +163,7 @@ export class RenderInfo extends BaseRenderInfo {
167163 // Spacing between a non-input and the end of the row or a statement input.
168164 if ( ! Types . isInput ( prev ) && ( ! next || Types . isStatementInput ( next ) ) ) {
169165 // Between an editable field and the end of the row.
170- if ( Types . isField ( prev ) && ( prev as Field ) . isEditable ) {
166+ if ( Types . isField ( prev ) && prev . isEditable ) {
171167 return this . constants_ . MEDIUM_PADDING ;
172168 }
173169 // Padding at the end of an icon-only row to make the block shape clearer.
@@ -208,7 +204,7 @@ export class RenderInfo extends BaseRenderInfo {
208204 // Spacing between a non-input and an input.
209205 if ( ! Types . isInput ( prev ) && next && Types . isInput ( next ) ) {
210206 // Between an editable field and an input.
211- if ( Types . isField ( prev ) && ( prev as Field ) . isEditable ) {
207+ if ( Types . isField ( prev ) && prev . isEditable ) {
212208 if ( Types . isInlineInput ( next ) ) {
213209 return this . constants_ . SMALL_PADDING ;
214210 } else if ( Types . isExternalInput ( next ) ) {
@@ -233,7 +229,7 @@ export class RenderInfo extends BaseRenderInfo {
233229 // Spacing between an inline input and a field.
234230 if ( Types . isInlineInput ( prev ) && next && Types . isField ( next ) ) {
235231 // Editable field after inline input.
236- if ( ( next as Field ) . isEditable ) {
232+ if ( next . isEditable ) {
237233 return this . constants_ . MEDIUM_PADDING ;
238234 } else {
239235 // Noneditable field after inline input.
@@ -278,7 +274,7 @@ export class RenderInfo extends BaseRenderInfo {
278274 Types . isField ( prev ) &&
279275 next &&
280276 Types . isField ( next ) &&
281- ( prev as Field ) . isEditable === ( next as Field ) . isEditable
277+ prev . isEditable === next . isEditable
282278 ) {
283279 return this . constants_ . LARGE_PADDING ;
284280 }
@@ -323,20 +319,17 @@ export class RenderInfo extends BaseRenderInfo {
323319 return row . yPos + elem . height / 2 ;
324320 }
325321 if ( Types . isBottomRow ( row ) ) {
326- const bottomRow = row as BottomRow ;
327- const baseline =
328- bottomRow . yPos + bottomRow . height - bottomRow . descenderHeight ;
322+ const baseline = row . yPos + row . height - row . descenderHeight ;
329323 if ( Types . isNextConnection ( elem ) ) {
330324 return baseline + elem . height / 2 ;
331325 }
332326 return baseline - elem . height / 2 ;
333327 }
334328 if ( Types . isTopRow ( row ) ) {
335- const topRow = row as TopRow ;
336329 if ( Types . isHat ( elem ) ) {
337- return topRow . capline - elem . height / 2 ;
330+ return row . capline - elem . height / 2 ;
338331 }
339- return topRow . capline + elem . height / 2 ;
332+ return row . capline + elem . height / 2 ;
340333 }
341334
342335 let result = row . yPos ;
@@ -370,7 +363,7 @@ export class RenderInfo extends BaseRenderInfo {
370363 rowNextRightEdges . set ( row , nextRightEdge ) ;
371364 if ( Types . isInputRow ( row ) ) {
372365 if ( row . hasStatement ) {
373- this . alignStatementRow_ ( row as InputRow ) ;
366+ this . alignStatementRow_ ( row ) ;
374367 }
375368 if (
376369 prevInput &&
0 commit comments