You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
Fix Sprite doesn't updating region_rect value in certain conditions
This commit is contained in:
@@ -188,13 +188,15 @@ bool Sprite::is_region() const{
|
|||||||
|
|
||||||
void Sprite::set_region_rect(const Rect2& p_region_rect) {
|
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;
|
region_rect=p_region_rect;
|
||||||
if (region && changed) {
|
|
||||||
update();
|
if (region)
|
||||||
item_rect_changed();
|
item_rect_changed();
|
||||||
_change_notify("region_rect");
|
|
||||||
}
|
_change_notify("region_rect");
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect2 Sprite::get_region_rect() const {
|
Rect2 Sprite::get_region_rect() const {
|
||||||
|
|||||||
Reference in New Issue
Block a user