#include <canvas_navigation_manager.h>
Public Member Functions | |
| ImVec2 | Consume (ImVec2 wheel, float dt, float step_px, float snap_px) |
Public Attributes | |
| ImVec2 | residual {0.0f, 0.0f} |
| float | idle_seconds = 0.0f |
Turns wheel/trackpad deltas into pan steps that land on whole detents.
Pure state machine (no ImGui calls) so the feel is unit-testable. Input below the deadzone is ignored, direction reversals drop the residual, and the residual is discarded once input stops for kOverworldWheelIdleResetSec.
Definition at line 30 of file canvas_navigation_manager.h.
| ImVec2 yaze::editor::StickyWheelPan::Consume | ( | ImVec2 | wheel, |
| float | dt, | ||
| float | step_px, | ||
| float | snap_px ) |
| wheel | io.MouseWheelH / io.MouseWheel (positive = left / up). |
| step_px | pixels per wheel unit (a multiple of snap_px). |
| snap_px | detent size in screen pixels. |
Definition at line 412 of file canvas_navigation_manager.cc.
References idle_seconds, yaze::editor::kOverworldWheelDeadzone, yaze::editor::kOverworldWheelIdleResetSec, and residual.
Referenced by yaze::editor::CanvasNavigationManager::BeginCanvasViewport().
| ImVec2 yaze::editor::StickyWheelPan::residual {0.0f, 0.0f} |
Definition at line 31 of file canvas_navigation_manager.h.
Referenced by Consume().
| float yaze::editor::StickyWheelPan::idle_seconds = 0.0f |
Definition at line 32 of file canvas_navigation_manager.h.
Referenced by Consume().