-Allow negative texture scale in TextureButton, fixes #2956

This commit is contained in:
reduz 2015-12-29 08:47:13 -03:00
parent 135d5fb06d
commit 0c6a4b47a6

View File

@ -42,22 +42,22 @@ Size2 TextureButton::get_minimum_size() const {
else
rscale= hover->get_size();
} else
rscale= pressed->get_size()*scale;
rscale=pressed->get_size();
} else
rscale= normal->get_size();
return rscale*scale;
return rscale*scale.abs();
}
bool TextureButton::has_point(const Point2& p_point) const {
if (scale[0] <= 0 || scale[1] <= 0) {
if (scale[0] == 0 || scale[1] == 0) {
return false;
}
Point2 ppos = p_point/scale;
Point2 ppos = p_point/scale.abs();
if (click_mask.is_valid()) {