Fix: Draw unavailable mask over picker sprite instead of behind it.

This makes these disabled picker buttons consistent with other disabled buttons.
This commit is contained in:
Peter Nelson
2023-12-20 00:20:51 +00:00
committed by Peter Nelson
parent 712a4bb40b
commit 7466c3c39e
3 changed files with 11 additions and 12 deletions

View File

@@ -358,9 +358,6 @@ public:
const ObjectSpec *spec = objclass->GetSpec(obj_index);
if (spec == nullptr) break;
if (!spec->IsAvailable()) {
GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), PC_BLACK, FILLRECT_CHECKER);
}
DrawPixelInfo tmp_dpi;
/* Set up a clipping area for the preview. */
Rect ir = r.Shrink(WidgetDimensions::scaled.bevel);
@@ -375,6 +372,9 @@ public:
std::min<int>(_selected_object_view, spec->views - 1));
}
}
if (!spec->IsAvailable()) {
GfxFillRect(ir, PC_BLACK, FILLRECT_CHECKER);
}
break;
}