Merge branch 'fix-key-press-checks' into 'master'

Use keyboard's coordinate system to check for presses

See merge request Librem5/squeekboard!118
This commit is contained in:
Dorota Czaplejewicz
2019-08-04 10:52:58 +00:00

View File

@ -1110,16 +1110,16 @@ eek_renderer_find_key_by_position (EekRenderer *renderer,
x = (x - priv->origin_x)/priv->scale - bounds.x; x = (x - priv->origin_x)/priv->scale - bounds.x;
y = (y - priv->origin_y)/priv->scale - bounds.y; y = (y - priv->origin_y)/priv->scale - bounds.y;
if (x < bounds.x || if (x < 0 ||
y < bounds.y || y < 0 ||
x > bounds.width || x > bounds.width ||
y > bounds.height) y > bounds.height)
return NULL; return NULL;
data.point.x = x; data.point.x = x;
data.point.y = y; data.point.y = y;
data.origin.x = bounds.x; data.origin.x = 0;
data.origin.y = bounds.y; data.origin.y = 0;
data.key = NULL; data.key = NULL;
data.renderer = renderer; data.renderer = renderer;