Restrict 1000d9684
to overlays only
Allowing empty paths for buttons too breaks auto-assignment of non-specified button images in themes.
This commit is contained in:
parent
3ad8dda48e
commit
8128093f61
1 changed files with 3 additions and 2 deletions
|
@ -394,7 +394,7 @@ bool button::hit(int x, int y) const
|
||||||
return sdl::point_in_rect(x,y,location());
|
return sdl::point_in_rect(x,y,location());
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_valid_image(const std::string& str) { return str[0] != IMAGE_PREFIX; }
|
static bool is_valid_image(const std::string& str) { return !str.empty() && str[0] != IMAGE_PREFIX; }
|
||||||
|
|
||||||
void button::set_image(const std::string& image_file)
|
void button::set_image(const std::string& image_file)
|
||||||
{
|
{
|
||||||
|
@ -409,7 +409,8 @@ void button::set_image(const std::string& image_file)
|
||||||
|
|
||||||
void button::set_overlay(const std::string& image_file)
|
void button::set_overlay(const std::string& image_file)
|
||||||
{
|
{
|
||||||
if(!is_valid_image(image_file)) {
|
// We allow empty paths for overlays
|
||||||
|
if(image_file[0] == IMAGE_PREFIX) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue