Rearranged ViewportNavigationControl.

This commit is contained in:
Relintai 2022-12-12 15:55:25 +01:00
parent 37961b1990
commit 94a9792d02

View File

@ -872,14 +872,9 @@ public:
class ViewportNavigationControl : public Control { class ViewportNavigationControl : public Control {
GDCLASS(ViewportNavigationControl, Control); GDCLASS(ViewportNavigationControl, Control);
SpatialEditorViewport *viewport = nullptr; public:
Vector2i focused_mouse_start; void set_navigation_mode(SpatialEditorViewport::NavigationMode p_nav_mode);
Vector2 focused_pos; void set_viewport(SpatialEditorViewport *p_viewport);
bool hovered = false;
int focused_index = -1;
SpatialEditorViewport::NavigationMode nav_mode = SpatialEditorViewport::NavigationMode::NAVIGATION_NONE;
const float AXIS_CIRCLE_RADIUS = 30.0f * EDSCALE;
protected: protected:
static void _bind_methods(); static void _bind_methods();
@ -892,9 +887,15 @@ protected:
void _process_drag(int p_index, Vector2 p_position, Vector2 p_relative_position); void _process_drag(int p_index, Vector2 p_position, Vector2 p_relative_position);
void _update_navigation(); void _update_navigation();
public: private:
void set_navigation_mode(SpatialEditorViewport::NavigationMode p_nav_mode); SpatialEditorViewport *viewport = nullptr;
void set_viewport(SpatialEditorViewport *p_viewport); Vector2i focused_mouse_start;
Vector2 focused_pos;
bool hovered = false;
int focused_index = -1;
SpatialEditorViewport::NavigationMode nav_mode = SpatialEditorViewport::NavigationMode::NAVIGATION_NONE;
const float AXIS_CIRCLE_RADIUS = 30.0f * EDSCALE;
}; };
#endif #endif