summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-03-06 09:45:23 +0100
committerRémi Verschelde <remi@verschelde.fr>2016-03-06 09:45:23 +0100
commit754d24612f61b5301fd5e8664d4ebc00bed3b061 (patch)
tree144417906f88325a365550dfa28ddcf756a91da7 /scene
parent4fb729362b750657d3a9a43ba7be31609dc6578b (diff)
parent1d188c1c7b37ab2661042492325a9da97d096c8c (diff)
Merge pull request #3931 from TheHX/issue-3876
Fix Sprite doesn't updating region_rect value in certain conditions
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/sprite.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp
index 001a1366a9..b2902b2867 100644
--- a/scene/2d/sprite.cpp
+++ b/scene/2d/sprite.cpp
@@ -188,13 +188,15 @@ bool Sprite::is_region() const{
void Sprite::set_region_rect(const Rect2& p_region_rect) {
- bool changed=region_rect!=p_region_rect;
+ if (region_rect==p_region_rect)
+ return;
+
region_rect=p_region_rect;
- if (region && changed) {
- update();
+
+ if (region)
item_rect_changed();
- _change_notify("region_rect");
- }
+
+ _change_notify("region_rect");
}
Rect2 Sprite::get_region_rect() const {