mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
The window zooming is now depending on LCD_WIDTH and LCD_HEIGHT.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2730 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
bc254fe95f
commit
93b5f92c53
1 changed files with 8 additions and 8 deletions
|
|
@ -45,8 +45,7 @@
|
||||||
GC draw_gc;
|
GC draw_gc;
|
||||||
static Colormap cmap;
|
static Colormap cmap;
|
||||||
|
|
||||||
static long maxx, maxy;
|
static int display_zoom=1;
|
||||||
static int display_zoom=2;
|
|
||||||
|
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
Window window;
|
Window window;
|
||||||
|
|
@ -80,17 +79,18 @@ void init_window ()
|
||||||
get_pixel_resource ("foreground", "Foreground", dpy, cmap);
|
get_pixel_resource ("foreground", "Foreground", dpy, cmap);
|
||||||
draw_gc = XCreateGC (dpy, window, GCForeground, &gcv);
|
draw_gc = XCreateGC (dpy, window, GCForeground, &gcv);
|
||||||
|
|
||||||
screen_resized(200, 100);
|
screen_resized(LCD_WIDTH, LCD_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void screen_resized(int width, int height)
|
void screen_resized(int width, int height)
|
||||||
{
|
{
|
||||||
maxx = width-1;
|
int maxx, maxy;
|
||||||
maxy = height-1;
|
maxx = width;
|
||||||
|
maxy = height;
|
||||||
|
|
||||||
display_zoom = maxy/64;
|
display_zoom = maxy/LCD_HEIGHT;
|
||||||
if (maxx/120 < display_zoom)
|
if (maxx/LCD_WIDTH < display_zoom)
|
||||||
display_zoom = maxx/120;
|
display_zoom = maxx/LCD_WIDTH;
|
||||||
if (display_zoom<1)
|
if (display_zoom<1)
|
||||||
display_zoom = 1;
|
display_zoom = 1;
|
||||||
XSetForeground (dpy, draw_gc, get_pixel_resource ("background", "Background",
|
XSetForeground (dpy, draw_gc, get_pixel_resource ("background", "Background",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue