From 11b3bb228adeec80612da1d60df4ab9c11cb7037 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 17 Jul 2011 14:48:19 +0000 Subject: Correct aspect ratio correctly and support widescreen displays svn path=/trunk/netsurf/; revision=12607 --- amiga/font.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'amiga/font.c') diff --git a/amiga/font.c b/amiga/font.c index ab4af75fb..c4ea0e514 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -657,7 +657,6 @@ void ami_font_setdevicedpi(int id) { DisplayInfoHandle dih; struct DisplayInfo dinfo; - Point dinfo_res; ULONG ydpi = option_amiga_ydpi; ULONG xdpi = option_amiga_ydpi; @@ -670,11 +669,21 @@ void ami_font_setdevicedpi(int id) if(GetDisplayInfoData(dih, &dinfo, sizeof(struct DisplayInfo), DTAG_DISP, 0)) { - dinfo_res = dinfo.Resolution; - xdpi = (dinfo_res.x / dinfo_res.y) * ydpi; + int xres = dinfo.Resolution.x; + int yres = dinfo.Resolution.y; - LOG(("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %ld x %ld)", - xdpi, ydpi, dinfo_res.x , dinfo_res.y)); + if(option_widescreen) + { + /* AmigaOS sees 4:3 modes as square in the DisplayInfo database, + * so we correct 16:10 modes to square for widescreen displays. */ + xres = (xres * 16) / 4; + yres = (yres * 10) / 3; + } + + xdpi = (yres * ydpi) / xres; + + LOG(("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %ld x %ld, corrected %ld x %ld)", + xdpi, ydpi, dinfo.Resolution.x, dinfo.Resolution.y, xres, yres)); } } } -- cgit v1.2.3