mirror of
https://github.com/brl/mutter.git
synced 2025-02-09 18:04:09 +00:00
backends/native: Switch the pressurecurve points to graphene points
No functional changes but a little bit of type-safety for future patches. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3399>
This commit is contained in:
parent
5ec67a8e90
commit
4d6add290e
@ -102,10 +102,10 @@ meta_input_device_tool_native_set_pressure_curve_in_impl (ClutterInputDeviceTool
|
|||||||
curve[3] >= 0 && curve[3] <= 1);
|
curve[3] >= 0 && curve[3] <= 1);
|
||||||
|
|
||||||
evdev_tool = META_INPUT_DEVICE_TOOL_NATIVE (tool);
|
evdev_tool = META_INPUT_DEVICE_TOOL_NATIVE (tool);
|
||||||
evdev_tool->pressure_curve[0] = curve[0];
|
evdev_tool->pressure_curve[0].x = curve[0];
|
||||||
evdev_tool->pressure_curve[1] = curve[1];
|
evdev_tool->pressure_curve[0].y = curve[1];
|
||||||
evdev_tool->pressure_curve[2] = curve[2];
|
evdev_tool->pressure_curve[1].x = curve[2];
|
||||||
evdev_tool->pressure_curve[3] = curve[3];
|
evdev_tool->pressure_curve[1].y = curve[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -162,10 +162,10 @@ meta_input_device_tool_native_translate_pressure_in_impl (ClutterInputDeviceTool
|
|||||||
evdev_tool = META_INPUT_DEVICE_TOOL_NATIVE (tool);
|
evdev_tool = META_INPUT_DEVICE_TOOL_NATIVE (tool);
|
||||||
|
|
||||||
return calculate_bezier_position (CLAMP (pressure, 0, 1),
|
return calculate_bezier_position (CLAMP (pressure, 0, 1),
|
||||||
evdev_tool->pressure_curve[0],
|
evdev_tool->pressure_curve[0].x,
|
||||||
evdev_tool->pressure_curve[1],
|
evdev_tool->pressure_curve[0].y,
|
||||||
evdev_tool->pressure_curve[2],
|
evdev_tool->pressure_curve[1].x,
|
||||||
evdev_tool->pressure_curve[3]);
|
evdev_tool->pressure_curve[1].y);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#error "This header cannot be included directly. Use "backends/native/meta-input-thread.h""
|
#error "This header cannot be included directly. Use "backends/native/meta-input-thread.h""
|
||||||
#endif /* META_INPUT_THREAD_H_INSIDE */
|
#endif /* META_INPUT_THREAD_H_INSIDE */
|
||||||
|
|
||||||
|
#include <graphene.h>
|
||||||
#include <libinput.h>
|
#include <libinput.h>
|
||||||
|
|
||||||
#include "clutter/clutter.h"
|
#include "clutter/clutter.h"
|
||||||
@ -59,7 +60,7 @@ struct _MetaInputDeviceToolNative
|
|||||||
ClutterInputDeviceTool parent_instance;
|
ClutterInputDeviceTool parent_instance;
|
||||||
struct libinput_tablet_tool *tool;
|
struct libinput_tablet_tool *tool;
|
||||||
GHashTable *button_map;
|
GHashTable *button_map;
|
||||||
double pressure_curve[4];
|
graphene_point_t pressure_curve[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MetaInputDeviceToolNativeClass
|
struct _MetaInputDeviceToolNativeClass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user