From c330f5cfbb240747d2313be416062b76fd189739 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 4 Nov 2024 10:21:05 -0800 Subject: [PATCH] refactor: Make dropdown field image metrics static. --- core/field_dropdown.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/field_dropdown.ts b/core/field_dropdown.ts index 854718e49c..e5b81a0fb6 100644 --- a/core/field_dropdown.ts +++ b/core/field_dropdown.ts @@ -99,10 +99,10 @@ export class FieldDropdown extends Field { * The y offset from the top of the field to the top of the image, if an image * is selected. */ - protected IMAGE_Y_OFFSET = 5; + protected static IMAGE_Y_OFFSET = 5; /** The total vertical padding above and below an image. */ - protected IMAGE_Y_PADDING = this.IMAGE_Y_OFFSET * 2; + protected static IMAGE_Y_PADDING = FieldDropdown.IMAGE_Y_OFFSET * 2; /** * @param menuGenerator A non-empty array of options for a dropdown list, or a @@ -529,7 +529,7 @@ export class FieldDropdown extends Field { const hasBorder = !!this.borderRect_; const height = Math.max( hasBorder ? this.getConstants()!.FIELD_DROPDOWN_BORDER_RECT_HEIGHT : 0, - imageHeight + this.IMAGE_Y_PADDING, + imageHeight + FieldDropdown.IMAGE_Y_PADDING, ); const xPadding = hasBorder ? this.getConstants()!.FIELD_BORDER_RECT_X_PADDING