mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 12:12:28 +00:00
add bounds to next keying next
This commit is contained in:
parent
dcb1b8247f
commit
e5759b7ff9
@ -623,14 +623,17 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) {
|
|||||||
if (property == "frame_coords" && (object->is_class("Sprite2D") || object->is_class("Sprite3D"))) {
|
if (property == "frame_coords" && (object->is_class("Sprite2D") || object->is_class("Sprite3D"))) {
|
||||||
Vector2i new_coords = object->get(property);
|
Vector2i new_coords = object->get(property);
|
||||||
new_coords.x++;
|
new_coords.x++;
|
||||||
if (new_coords.x >= object->get("hframes").operator int64_t()) {
|
if (new_coords.x >= int64_t(object->get("hframes"))) {
|
||||||
new_coords.x = 0;
|
new_coords.x = 0;
|
||||||
new_coords.y++;
|
new_coords.y++;
|
||||||
}
|
}
|
||||||
|
if (new_coords.x < int64_t(object->get("hframes")) && new_coords.y < int64_t(object->get("vframes"))) {
|
||||||
call_deferred(SNAME("emit_changed"), property, new_coords, "", false);
|
call_deferred(SNAME("emit_changed"), property, new_coords, "", false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
call_deferred(SNAME("emit_changed"), property, object->get(property).operator int64_t() + 1, "", false);
|
if (int64_t(object->get(property)) + 1 < (int64_t(object->get("hframes")) * int64_t(object->get("vframes")))) {
|
||||||
|
call_deferred(SNAME("emit_changed"), property, object->get(property).operator int64_t() + 1, "", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
call_deferred(SNAME("update_property"));
|
call_deferred(SNAME("update_property"));
|
||||||
|
Loading…
Reference in New Issue
Block a user