mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
[Core] Add scalar versions of Vector* min/max/clamp/snap(ped)
Convenience for a number of cases operating on single values
This commit is contained in:
parent
f91db3dc58
commit
308dbb8c63
73 changed files with 588 additions and 105 deletions
|
|
@ -328,7 +328,7 @@ void TextureRegionEditor::_texture_overlay_input(const Ref<InputEvent> &p_input)
|
|||
|
||||
drag_from = mtx.affine_inverse().xform(mb->get_position());
|
||||
if (snap_mode == SNAP_PIXEL) {
|
||||
drag_from = drag_from.snapped(Vector2(1, 1));
|
||||
drag_from = drag_from.snappedf(1);
|
||||
} else if (snap_mode == SNAP_GRID) {
|
||||
drag_from = snap_point(drag_from);
|
||||
}
|
||||
|
|
@ -566,7 +566,7 @@ void TextureRegionEditor::_texture_overlay_input(const Ref<InputEvent> &p_input)
|
|||
} else {
|
||||
Vector2 new_pos = mtx.affine_inverse().xform(mm->get_position());
|
||||
if (snap_mode == SNAP_PIXEL) {
|
||||
new_pos = new_pos.snapped(Vector2(1, 1));
|
||||
new_pos = new_pos.snappedf(1);
|
||||
} else if (snap_mode == SNAP_GRID) {
|
||||
new_pos = snap_point(new_pos);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue