Skip to content

Commit

Permalink
Merge pull request #960 from Flyga-M/fix/panel-icon
Browse files Browse the repository at this point in the history
fix: fix panel header icon texture check
  • Loading branch information
dlamkins authored Apr 18, 2024
2 parents 8a8b53d + 1ac679a commit b26c7c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Blish HUD/Controls/Panel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public override void RecalculateLayout() {

_layoutHeaderBounds = new Rectangle(this.ContentRegion.Left, 0, this.ContentRegion.Width, HEADER_HEIGHT);

if (_icon?.HasTexture != null) {
if (_icon?.HasTexture == true) {

_layoutHeaderIconBounds = new Rectangle(_layoutHeaderBounds.Left + 3, 3, HEADER_HEIGHT - 6, HEADER_HEIGHT - 6);
_layoutHeaderTextBounds = new Rectangle(_layoutHeaderIconBounds.Right + 5, 0, _layoutHeaderBounds.Width - _layoutHeaderIconBounds.Width, HEADER_HEIGHT);
Expand Down Expand Up @@ -352,7 +352,7 @@ public override void PaintBeforeChildren(SpriteBatch spriteBatch, Rectangle boun
}

// Panel header icon
if (_icon?.HasTexture != null) {
if (_icon?.HasTexture == true) {
spriteBatch.DrawOnCtrl(this, _icon, _layoutHeaderIconBounds, Color.White);
}

Expand Down

0 comments on commit b26c7c0

Please sign in to comment.