forked from enlightenment/efl
efl: Add precise_position for input events
The previous commit removed useless delta
This commit is contained in:
parent
e28aba0542
commit
986e5e8827
|
@ -21,6 +21,12 @@ struct @extern Eina.Size2D {
|
||||||
|
|
||||||
struct @extern Eina.File; [[Eina file data structure]]
|
struct @extern Eina.File; [[Eina file data structure]]
|
||||||
|
|
||||||
|
struct @extern Eina.Vector2 {
|
||||||
|
[[A simple 2D vector type using floating point values.]]
|
||||||
|
x: double; [[X coordinate.]]
|
||||||
|
y: double; [[Y coordinate.]]
|
||||||
|
}
|
||||||
|
|
||||||
struct @extern Eina.Matrix3 {
|
struct @extern Eina.Matrix3 {
|
||||||
[[Eina 3x3 Matrix]]
|
[[Eina 3x3 Matrix]]
|
||||||
xx: double; [[XX matrix value]]
|
xx: double; [[XX matrix value]]
|
||||||
|
|
|
@ -223,6 +223,20 @@ _efl_input_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
|
||||||
return EINA_POSITION2D((int) pd->cur.x, (int) pd->cur.y);
|
return EINA_POSITION2D((int) pd->cur.x, (int) pd->cur.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EOLIAN static void
|
||||||
|
_efl_input_pointer_precise_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Eina_Vector2 pos)
|
||||||
|
{
|
||||||
|
_efl_input_value_mark(pd, EFL_INPUT_VALUE_X);
|
||||||
|
_efl_input_value_mark(pd, EFL_INPUT_VALUE_Y);
|
||||||
|
pd->cur = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
EOLIAN static Eina_Vector2
|
||||||
|
_efl_input_pointer_precise_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
|
||||||
|
{
|
||||||
|
return pd->cur;
|
||||||
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_input_pointer_previous_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Eina_Position2D pos)
|
_efl_input_pointer_previous_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Eina_Position2D pos)
|
||||||
{
|
{
|
||||||
|
|
|
@ -70,15 +70,27 @@ class Efl.Input.Pointer (Efl.Object, Efl.Input.Event, Efl.Input.State)
|
||||||
@property position {
|
@property position {
|
||||||
[[Position where the event happened, relative to the window.
|
[[Position where the event happened, relative to the window.
|
||||||
|
|
||||||
This position, in integers, is an approximation of
|
See @.precise_position for floating point precision (subpixel
|
||||||
@.value.get($x), @.value.get($y). Use @.position if you need
|
location).
|
||||||
simple pixel positions, but prefer the generic interface
|
|
||||||
if you need precise coordinates.
|
|
||||||
]]
|
]]
|
||||||
values {
|
values {
|
||||||
pos: Eina.Position2D; [[The position of the event, in pixels.]]
|
pos: Eina.Position2D; [[The position of the event, in pixels.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@property precise_position {
|
||||||
|
[[Position where the event happened, relative to the window.
|
||||||
|
|
||||||
|
This position is in floating point values, for more precise
|
||||||
|
coordinates, in subpixels. Note that many input devices are unable
|
||||||
|
to give better precision than a single pixel, so this may be
|
||||||
|
equal to @.position.
|
||||||
|
|
||||||
|
See also @.position.
|
||||||
|
]]
|
||||||
|
values {
|
||||||
|
pos: Eina.Vector2; [[The position of the event, in pixels.]]
|
||||||
|
}
|
||||||
|
}
|
||||||
@property previous_position {
|
@property previous_position {
|
||||||
[[Position of the previous event, valid for move events.
|
[[Position of the previous event, valid for move events.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue