You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
[Wayland] Fix tilt handling
This commit is contained in:
@@ -2424,8 +2424,7 @@ void WaylandThread::_wp_tablet_tool_on_frame(void *data, struct zwp_tablet_tool_
|
|||||||
// According to the tablet proto spec, tilt is expressed in degrees relative
|
// According to the tablet proto spec, tilt is expressed in degrees relative
|
||||||
// to the Z axis of the tablet, so it shouldn't go over 90 degrees either way,
|
// to the Z axis of the tablet, so it shouldn't go over 90 degrees either way,
|
||||||
// I think. We'll clamp it just in case.
|
// I think. We'll clamp it just in case.
|
||||||
td.tilt.x = CLAMP(td.tilt.x, -90, 90);
|
td.tilt = td.tilt.clamp(Vector2(-90, -90), Vector2(90, 90));
|
||||||
td.tilt.y = CLAMP(td.tilt.x, -90, 90);
|
|
||||||
|
|
||||||
mm->set_tilt(td.tilt / 90);
|
mm->set_tilt(td.tilt / 90);
|
||||||
|
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ public:
|
|||||||
|
|
||||||
struct TabletToolData {
|
struct TabletToolData {
|
||||||
Point2i position;
|
Point2i position;
|
||||||
Vector2i tilt;
|
Vector2 tilt;
|
||||||
uint32_t pressure = 0;
|
uint32_t pressure = 0;
|
||||||
|
|
||||||
BitField<MouseButtonMask> pressed_button_mask;
|
BitField<MouseButtonMask> pressed_button_mask;
|
||||||
|
|||||||
Reference in New Issue
Block a user