160 float velocity_mag = std::sqrt(
179 if (std::abs(zoom_delta) > 0.001f) {
186 ImVec2 center_in_canvas = ImVec2(
194 center_in_canvas.x * scale_ratio;
196 center_in_canvas.y * scale_ratio;
219 float velocity_mag = std::sqrt(
void SetScrollOffset(ImVec2 offset)
Set the scroll offset (e.g., from Canvas state)
void SetScale(float scale)
Set the zoom scale.
bool IsTouchMode() const
Check if we're in touch mode (vs mouse)
void ApplyScrollDelta(ImVec2 delta)
Apply a scroll delta (add to current offset)
void ProcessGesture(const GestureState &gesture)
void ApplyZoomDelta(float delta, ImVec2 center)
Apply a zoom delta around a center point.
void Update()
Update touch state each frame.
void Initialize(const std::string &canvas_id="")
Initialize the touch handler.
void Reset()
Reset to default state (no pan, 1.0 scale)
bool IsTouchActive() const
Check if touch input is currently active.
void ProcessForCanvas(ImVec2 canvas_p0, ImVec2 canvas_sz, bool is_hovered)
Process touch gestures for the current canvas bounds.
float inertia_deceleration
float inertia_min_velocity
Gesture recognition result.