1
0
Fork 0

Allow Control Rect tool to not snap to pixel

This commit is contained in:
kit 2025-03-27 20:30:54 -04:00
parent 730adf4801
commit e6cb7affdc
1 changed files with 2 additions and 2 deletions

View File

@ -130,8 +130,8 @@ Size2 Control::_edit_get_scale() const {
void Control::_edit_set_rect(const Rect2 &p_edit_rect) { void Control::_edit_set_rect(const Rect2 &p_edit_rect) {
ERR_FAIL_COND_MSG(!Engine::get_singleton()->is_editor_hint(), "This function can only be used from editor plugins."); ERR_FAIL_COND_MSG(!Engine::get_singleton()->is_editor_hint(), "This function can only be used from editor plugins.");
set_position((get_position() + get_transform().basis_xform(p_edit_rect.position)).snappedf(1), ControlEditorToolbar::get_singleton()->is_anchors_mode_enabled()); set_position((get_position() + get_transform().basis_xform(p_edit_rect.position)), ControlEditorToolbar::get_singleton()->is_anchors_mode_enabled());
set_size(p_edit_rect.size.snappedf(1), ControlEditorToolbar::get_singleton()->is_anchors_mode_enabled()); set_size(p_edit_rect.size, ControlEditorToolbar::get_singleton()->is_anchors_mode_enabled());
} }
void Control::_edit_set_rotation(real_t p_rotation) { void Control::_edit_set_rotation(real_t p_rotation) {