From 33af0dec28cf31be0ce7195b90546861efcce76f Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Wed, 10 Nov 2010 15:25:15 +0000 Subject: Touchscreen: Improved scroll threshold Remove the hardcoded (and way too small) scroll threshold (the distance moved in pixels before we think the users wants to scroll) and replace it with something based on the actual DPI of the screen. On Android we call the API for that, on other touchscreens we reimplemented Android's formula (as of 2.2) and calculate it. Flyspray: 11727 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28548 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/hosted/sdl/lcd-sdl.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'firmware/target/hosted/sdl/lcd-sdl.c') diff --git a/firmware/target/hosted/sdl/lcd-sdl.c b/firmware/target/hosted/sdl/lcd-sdl.c index 15e4ba95c3..96b1a04aa6 100644 --- a/firmware/target/hosted/sdl/lcd-sdl.c +++ b/firmware/target/hosted/sdl/lcd-sdl.c @@ -111,3 +111,9 @@ void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end, SDL_SetPalette(surface, SDL_LOGPAL|SDL_PHYSPAL, palette, first, steps); } +int lcd_get_dpi(void) +{ + /* TODO: find a way to query it from the OS, SDL doesn't support it + * directly; for now assume the more or less standard 96 */ + return 96; +} -- cgit v1.2.3