summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2015-12-29 08:47:13 -0300
committerreduz <reduzio@gmail.com>2015-12-29 08:47:13 -0300
commit0c6a4b47a67774c1a29251058d40e9733a13102e (patch)
treeb71b12db20b15c6c51fd6e1e772a30d113741ba4 /scene
parent135d5fb06d268e4a493e612bded0a52484714684 (diff)
-Allow negative texture scale in TextureButton, fixes #2956
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/texture_button.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp
index 7e6bf2cbdf..3d1b080ef2 100644
--- a/scene/gui/texture_button.cpp
+++ b/scene/gui/texture_button.cpp
@@ -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()) {