mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 12:36:51 +03:00
Correct aspect ratio correctly and support widescreen displays
svn path=/trunk/netsurf/; revision=12607
This commit is contained in:
parent
31d1313944
commit
11b3bb228a
1
amiga/dist/NetSurf.guide
vendored
1
amiga/dist/NetSurf.guide
vendored
@ -43,6 +43,7 @@ There are a couple of Amiga-specific options which can only be changed directly
|
||||
@{b}printer_unit@{ub} Specifies which printer.device unit to print to
|
||||
@{b}drag_save_icons@{ub} Enables displaying Workbench-style transparent icons under the pointer when performing drag saves (ctrl-drag of objects available if NetSurf is running on the Workbench screen) and text selection drags. If set to 0 the pointer style will change instead. OS 4.0 users may want to set this to 0 as icons will appear opaque and obscure the drop position.
|
||||
@{b}cairo_renderer@{ub} Set rendering engine (SObjs version only). 0 = graphics.library, 1 = Cairo/graphics.library mixed (recommended), 2 = Full Cairo.
|
||||
@{b}widescreen@{ub} Correct aspect ratio for widescreen displays.
|
||||
|
||||
@{b}url_file@{ub} Path to URL database file
|
||||
@{b}hotlist_file@{ub} Path to Hotlist file
|
||||
|
19
amiga/font.c
19
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -66,6 +66,7 @@ extern int option_cookies_window_ysize;
|
||||
extern int option_cairo_renderer;
|
||||
extern bool option_direct_render;
|
||||
extern int option_amiga_ydpi;
|
||||
extern bool option_widescreen;
|
||||
|
||||
#define EXTRA_OPTION_DEFINE \
|
||||
char *option_url_file = 0; \
|
||||
@ -114,6 +115,7 @@ int option_cookies_window_ysize = 0; \
|
||||
int option_cairo_renderer = 1; \
|
||||
bool option_direct_render = false; \
|
||||
int option_amiga_ydpi = 72; \
|
||||
bool option_widescreen = false; \
|
||||
|
||||
#define EXTRA_OPTION_TABLE \
|
||||
{ "url_file", OPTION_STRING, &option_url_file }, \
|
||||
@ -161,5 +163,6 @@ int option_amiga_ydpi = 72; \
|
||||
{ "cookies_window_ysize", OPTION_INTEGER, &option_cookies_window_ysize}, \
|
||||
{ "cairo_renderer", OPTION_INTEGER, &option_cairo_renderer}, \
|
||||
{ "direct_render", OPTION_BOOL, &option_direct_render}, \
|
||||
{ "amiga_ydpi", OPTION_INTEGER, &option_amiga_ydpi},
|
||||
{ "amiga_ydpi", OPTION_INTEGER, &option_amiga_ydpi}, \
|
||||
{ "widescreen", OPTION_BOOL, &option_widescreen},
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user