Add drag zoom feature with CTRL+MiddleMouseButton

This change introduces a DragType enum to scene/gui/view_panner.cpp of
dragging, which includes:

- DRAG_TYPE_NONE: Not dragging
- DRAG_TYPE_PAN: Panning (dragging using MMB)
- DRAG_TYPE_ZOOM: Zooming (dragging using CTRL+MMB)

The goal of this change is the third option, which was already available
in 3D viewport but not in 2D. This feature should work in other editors
as well such as Animation Track Editor and Visual Shader Editor and so
on.
This commit is contained in:
hamid
2025-04-25 18:12:02 +03:30
parent 80a3d205f1
commit 82e23da12e
7 changed files with 67 additions and 15 deletions

View File

@@ -582,6 +582,9 @@
<member name="editors/panning/warped_mouse_panning" type="bool" setter="" getter="">
If [code]true[/code], warps the mouse around the 2D viewport while panning in the 2D editor. This makes it possible to pan over a large area without having to exit panning and adjust the mouse cursor.
</member>
<member name="editors/panning/zoom_style" type="int" setter="" getter="">
The mouse cursor movement direction to use when drag-zooming in any editor (except 3D scene editor) by moving the mouse. This does not affect zooming with the mouse wheel.
</member>
<member name="editors/polygon_editor/auto_bake_delay" type="float" setter="" getter="">
The delay in seconds until more complex and performance costly polygon editors commit their outlines, e.g. the 2D navigation polygon editor rebakes the navigation mesh polygons. A negative value stops the auto bake.
</member>