Skip to content

Commit

Permalink
fix: Components loading with icon set (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctoddy authored Apr 25, 2024
1 parent c7928d7 commit bf22117
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ export default class Button extends Surface {
}

_updatePositions() {
if (this._hasPrefix) {
if (this._hasPrefix && this._Prefix !== undefined) {
this._Prefix.x = this._prefixX;
}
if (this._hasTitle) {
this._TextWrapper.x = this._titleX;
}
if (this._hasSuffix) {
if (this._hasSuffix && this._Suffix !== undefined) {
this._Suffix.x = this._suffixX;
}
}
Expand Down Expand Up @@ -340,7 +340,7 @@ export default class Button extends Surface {
}

get _prefixW() {
return this._hasPrefix ? this._Prefix.w : 0;
return this._hasPrefix && this._Prefix !== undefined ? this._Prefix.w : 0;
}

get _prefixX() {
Expand Down Expand Up @@ -373,7 +373,7 @@ export default class Button extends Surface {
}

get _suffixW() {
return this._hasSuffix ? this._Suffix.w : 0;
return this._hasSuffix && this._Suffix !== undefined ? this._Suffix.w : 0;
}

get _suffixX() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default class Control extends ButtonSmall {
2;
this._patchTitle(middle, 0.5);
}
} else {
} else if (this._Prefix !== undefined) {
const middle =
(this.w -
(this._paddingLeft +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ export default class Tab extends Surface {
}

get _iconW() {
return this.icon ? this._Icon.w : 0;
return this.icon && this._Icon !== undefined ? this._Icon.w : 0;
}

get _iconH() {
return this.icon ? this._Icon.h : 0;
return this.icon && this._Icon !== undefined ? this._Icon.h : 0;
}

get _paddingX() {
Expand Down

0 comments on commit bf22117

Please sign in to comment.