summaryrefslogtreecommitdiff
path: root/amiga/font.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2011-07-17 14:48:19 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2011-07-17 14:48:19 +0000
commit11b3bb228adeec80612da1d60df4ab9c11cb7037 (patch)
tree3fd4bf1e34c0b43a5d7b00b8491c450e16d5d599 /amiga/font.c
parent31d1313944c29c4a626d2fb392e7379f3f609bec (diff)
downloadnetsurf-11b3bb228adeec80612da1d60df4ab9c11cb7037.tar.gz
netsurf-11b3bb228adeec80612da1d60df4ab9c11cb7037.tar.bz2
Correct aspect ratio correctly and support widescreen displays
svn path=/trunk/netsurf/; revision=12607
Diffstat (limited to 'amiga/font.c')
-rw-r--r--amiga/font.c19
1 files changed, 14 insertions, 5 deletions
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));
}
}
}