diff options
Diffstat (limited to 'apps/gui/skin_engine/skin_touchsupport.c')
-rw-r--r-- | apps/gui/skin_engine/skin_touchsupport.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c index b92fd1e83e..045bc809c8 100644 --- a/apps/gui/skin_engine/skin_touchsupport.c +++ b/apps/gui/skin_engine/skin_touchsupport.c | |||
@@ -92,6 +92,18 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, | |||
92 | * are relative to a preceding viewport */ | 92 | * are relative to a preceding viewport */ |
93 | vx = x - wvp->vp.x; | 93 | vx = x - wvp->vp.x; |
94 | vy = y - wvp->vp.y; | 94 | vy = y - wvp->vp.y; |
95 | |||
96 | /* project touches in the padding region so they clamp to the | ||
97 | * edge of the region instead */ | ||
98 | if(r->x - r->wpad <= vx && vx < r->x) | ||
99 | vx = r->x; | ||
100 | else if(r->x + r->width <= vx && vx < r->x + r->width + r->wpad) | ||
101 | vx = r->x + r->width - 1; | ||
102 | if(r->y - r->hpad <= vy && vy < r->y) | ||
103 | vy = r->y; | ||
104 | else if(r->y + r->height <= vy && vy < r->y + r->height + r->hpad) | ||
105 | vy = r->y + r->height - 1; | ||
106 | |||
95 | /* now see if the point is inside this region */ | 107 | /* now see if the point is inside this region */ |
96 | if (vx >= r->x && vx < r->x+r->width && | 108 | if (vx >= r->x && vx < r->x+r->width && |
97 | vy >= r->y && vy < r->y+r->height) | 109 | vy >= r->y && vy < r->y+r->height) |