MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / backend_pen_motion_update

Method backend_pen_motion_update

src/InputManager.cpp:614–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612}
613
614void InputManager::backend_pen_motion_update(const SDL_PenMotionEvent& e) {
615 Vector2f mouseNewPos = backend_cursor_pos_calculation({e.x, e.y});
616 mouse.set_pos(mouseNewPos);
617
618 Vector2f mouseRel = mouseNewPos - pen.previousPos;
619 pen.previousPos = mouseNewPos;
620 pen.isEraser = e.pen_state & SDL_PEN_INPUT_ERASER_TIP;
621
622 main.input_mouse_motion_callback({
623 .deviceType = MouseDeviceType::PEN,
624 .pos = mouseNewPos,
625 .move = mouseRel
626 });
627 main.input_pen_motion_callback({
628 .pos = mouseNewPos,
629 .move = mouseRel
630 });
631
632 isTouchDevice = false;
633}
634
635void InputManager::backend_pen_axis_update(const SDL_PenAxisEvent& e) {
636 Vector2f mouseNewPos = backend_cursor_pos_calculation({e.x, e.y});

Callers 1

main.cppFile · 0.80

Calls 3

set_posMethod · 0.80

Tested by

no test coverage detected