Skip to content

Commit

Permalink
fix(linux/input): handle pen EVENT_MOVE events (#2841)
Browse files Browse the repository at this point in the history
  • Loading branch information
cfalas authored Jul 13, 2024
1 parent ba68caf commit 8187a28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/platform/linux/input/inputtino_pen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ namespace platf::pen {
tilt_y = std::atan2(std::cos(-rotation_rads) * r, z) * 180.f / M_PI;
}

bool is_touching = pen.eventType == LI_TOUCH_EVENT_DOWN || pen.eventType == LI_TOUCH_EVENT_MOVE;

(*raw->pen).place_tool(tool,
pen.x,
pen.y,
pen.eventType == LI_TOUCH_EVENT_DOWN ? pen.pressureOrDistance : -1,
pen.eventType == LI_TOUCH_EVENT_HOVER ? pen.pressureOrDistance : -1,
is_touching ? pen.pressureOrDistance : -1,
is_touching ? -1 : pen.pressureOrDistance,
tilt_x,
tilt_y);
}
Expand Down

0 comments on commit 8187a28

Please sign in to comment.