|
|
Donner 0.5.1
Embeddable browser-grade SVG2 engine
|
Headless classification for render-pane scroll gestures. main.cc feeds raw GLFW scroll events into this helper so tests can cover pan vs. zoom routing without depending on ImGui or GLFW. More...
#include <optional>#include "donner/base/Box.h"#include "donner/base/Vector2.h"#include "donner/editor/ViewportState.h"Classes | |
| struct | donner::editor::RenderPaneScrollEvent |
| Raw scroll event captured from the windowing layer. More... | |
| struct | donner::editor::RenderPaneGestureContext |
| Per-frame state needed to route a raw scroll event. More... | |
| struct | donner::editor::RenderPaneGestureAction |
| Output of ClassifyRenderPaneScrollGesture. More... | |
Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
Enumerations | |
| enum class | donner::editor::RenderPaneGestureActionType { Pan , Zoom } |
| The viewport mutation a scroll gesture should apply. | |
Functions | |
| std::optional< RenderPaneGestureAction > | donner::editor::ClassifyRenderPaneScrollGesture (const RenderPaneScrollEvent &event, const RenderPaneGestureContext &context, double wheelZoomStep, double panPixelsPerScrollUnit) |
| Route a raw scroll event to either pan or zoom. | |
| void | donner::editor::ApplyRenderPaneGesture (ViewportState &viewport, const RenderPaneGestureAction &action) |
| Apply a classified gesture action to the viewport. | |
Headless classification for render-pane scroll gestures. main.cc feeds raw GLFW scroll events into this helper so tests can cover pan vs. zoom routing without depending on ImGui or GLFW.
| void donner::editor::ApplyRenderPaneGesture | ( | ViewportState & | viewport, |
| const RenderPaneGestureAction & | action ) |
Apply a classified gesture action to the viewport.
| viewport | Viewport state to mutate. |
| action | Gesture action previously returned by ClassifyRenderPaneScrollGesture. |
|
nodiscard |
Route a raw scroll event to either pan or zoom.
Bare scroll inside the pane pans. Cmd/Ctrl-modified vertical scroll zooms around the cursor using the existing wheel-zoom step model. Events outside the pane, zero-delta events, and wheel input while a mouse-drag pan is active are ignored.
| event | Raw scroll event from GLFW. |
| context | Per-frame pane bounds and mouse-pan state. |
| wheelZoomStep | Multiplicative zoom step per +1.0 wheel unit. |
| panPixelsPerScrollUnit | Screen pixels to pan per +1.0 scroll unit. |