feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -33,6 +33,7 @@
|
|||
#include "core/input/input.h"
|
||||
#include "core/input/shortcut.h"
|
||||
#include "core/os/keyboard.h"
|
||||
#include "scene/main/viewport.h"
|
||||
|
||||
bool ViewPanner::gui_input(const Ref<InputEvent> &p_event, Rect2 p_canvas_rect) {
|
||||
Ref<InputEventMouseButton> mb = p_event;
|
||||
|
|
@ -109,8 +110,8 @@ bool ViewPanner::gui_input(const Ref<InputEvent> &p_event, Rect2 p_canvas_rect)
|
|||
Ref<InputEventMouseMotion> mm = p_event;
|
||||
if (mm.is_valid()) {
|
||||
if (is_dragging) {
|
||||
if (p_canvas_rect != Rect2()) {
|
||||
pan_callback.call(Input::get_singleton()->warp_mouse_motion(mm, p_canvas_rect), p_event);
|
||||
if (warped_panning_viewport && p_canvas_rect.has_area()) {
|
||||
pan_callback.call(warped_panning_viewport->wrap_mouse_in_rect(mm->get_relative(), p_canvas_rect), p_event);
|
||||
} else {
|
||||
pan_callback.call(mm->get_relative(), p_event);
|
||||
}
|
||||
|
|
@ -212,6 +213,10 @@ void ViewPanner::setup(ControlScheme p_scheme, Ref<Shortcut> p_shortcut, bool p_
|
|||
set_simple_panning_enabled(p_simple_panning);
|
||||
}
|
||||
|
||||
void ViewPanner::setup_warped_panning(Viewport *p_viewport, bool p_allowed) {
|
||||
warped_panning_viewport = p_allowed ? p_viewport : nullptr;
|
||||
}
|
||||
|
||||
bool ViewPanner::is_panning() const {
|
||||
return is_dragging || pan_key_pressed;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue