You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Fix region editor for NinePatchRect
This commit is contained in:
@@ -51,7 +51,7 @@
|
|||||||
The height of the 9-slice's top row.
|
The height of the 9-slice's top row.
|
||||||
</member>
|
</member>
|
||||||
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )">
|
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )">
|
||||||
Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one.
|
Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. If the rect is empty, NinePatchRect will use the whole texture.
|
||||||
</member>
|
</member>
|
||||||
<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
|
<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
|
||||||
The node's texture resource.
|
The node's texture resource.
|
||||||
|
|||||||
@@ -625,9 +625,12 @@ void TextureRegionEditor::_update_rect() {
|
|||||||
rect = node_sprite->get_region_rect();
|
rect = node_sprite->get_region_rect();
|
||||||
else if (node_sprite_3d)
|
else if (node_sprite_3d)
|
||||||
rect = node_sprite_3d->get_region_rect();
|
rect = node_sprite_3d->get_region_rect();
|
||||||
else if (node_ninepatch)
|
else if (node_ninepatch) {
|
||||||
rect = node_ninepatch->get_region_rect();
|
rect = node_ninepatch->get_region_rect();
|
||||||
else if (obj_styleBox.is_valid())
|
if (rect == Rect2()) {
|
||||||
|
rect = Rect2(Vector2(), node_ninepatch->get_texture()->get_size());
|
||||||
|
}
|
||||||
|
} else if (obj_styleBox.is_valid())
|
||||||
rect = obj_styleBox->get_region_rect();
|
rect = obj_styleBox->get_region_rect();
|
||||||
else if (atlas_tex.is_valid())
|
else if (atlas_tex.is_valid())
|
||||||
rect = atlas_tex->get_region();
|
rect = atlas_tex->get_region();
|
||||||
|
|||||||
Reference in New Issue
Block a user