diff --git a/src/feathers/controls/Header.hx b/src/feathers/controls/Header.hx index 42bf9f7a..5c8e2f63 100644 --- a/src/feathers/controls/Header.hx +++ b/src/feathers/controls/Header.hx @@ -799,9 +799,15 @@ class Header extends FeathersControl implements ITextControl { this.layoutBackgroundSkin(); var textFieldMinX = this.paddingLeft; - var textFieldMaxX = this.actualWidth - this.paddingRight; + var textFieldMaxX = Math.max(this.paddingLeft, this.actualWidth - this.paddingRight); var maxContentWidth = this.actualWidth - this.paddingLeft - this.paddingRight; + if (maxContentWidth < 0.0) { + maxContentWidth = 0.0; + } var maxContentHeight = this.actualHeight - this.paddingTop - this.paddingBottom; + if (maxContentHeight < 0.0) { + maxContentHeight = 0.0; + } var textFieldMaxWidth = maxContentWidth; if (this._leftView != null) { diff --git a/src/feathers/controls/Label.hx b/src/feathers/controls/Label.hx index 886af49b..d937ef2b 100644 --- a/src/feathers/controls/Label.hx +++ b/src/feathers/controls/Label.hx @@ -892,6 +892,9 @@ class Label extends FeathersControl implements ITextControl implements IHTMLText var textFieldHeight = this._textMeasuredHeight; var maxHeight = this.actualHeight - this.paddingTop - this.paddingBottom; + if (maxHeight < 0.0) { + maxHeight = 0.0; + } if (textFieldHeight > maxHeight) { textFieldHeight = maxHeight; } diff --git a/src/feathers/controls/TextInput.hx b/src/feathers/controls/TextInput.hx index 035771c2..0e9fe269 100644 --- a/src/feathers/controls/TextInput.hx +++ b/src/feathers/controls/TextInput.hx @@ -1774,6 +1774,9 @@ class TextInput extends FeathersControl implements IStateContext var textFieldHeight = this._textMeasuredHeight; var maxHeight = this.actualHeight - this.paddingTop - this.paddingBottom; + if (maxHeight < 0.0) { + maxHeight = 0.0; + } if (textFieldHeight > maxHeight || this.verticalAlign == JUSTIFY) { textFieldHeight = maxHeight; } diff --git a/src/feathers/controls/dataRenderers/ItemRenderer.hx b/src/feathers/controls/dataRenderers/ItemRenderer.hx index be99bccb..4f893efc 100644 --- a/src/feathers/controls/dataRenderers/ItemRenderer.hx +++ b/src/feathers/controls/dataRenderers/ItemRenderer.hx @@ -1004,7 +1004,13 @@ class ItemRenderer extends ToggleButton implements IFocusContainer implements IL var hasSecondaryText = this.showSecondaryText && this._secondaryText != null; var hasSecondaryHTMLText = this.showSecondaryText && this._secondaryHtmlText != null && this._secondaryHtmlText.length > 0; var availableContentWidth = this.actualWidth - this.paddingLeft - this.paddingRight; + if (availableContentWidth < 0.0) { + availableContentWidth = 0.0; + } var availableContentHeight = this.actualHeight - this.paddingTop - this.paddingBottom; + if (availableContentHeight < 0.0) { + availableContentHeight = 0.0; + } var totalContentWidth = (hasText || hasHTMLText) ? this._textMeasuredWidth : 0.0; var totalContentHeight = (hasText || hasHTMLText) ? this._textMeasuredHeight : 0.0; if ((hasSecondaryText || hasSecondaryHTMLText) && this.secondaryTextField != null) {