More mouse fixes.
This commit is contained in:
@@ -168,7 +168,11 @@ mouse_clear_buttons(void)
|
||||
static double
|
||||
mouse_scale_coord_x(double x, int mul)
|
||||
{
|
||||
double ratio = (double) monitors[0].mon_unscaled_size_x / (double) monitors[0].mon_res_x;
|
||||
double ratio = 1.0;
|
||||
|
||||
if (!mouse_raw)
|
||||
ratio = (monitors[0].mon_res_x * plat_get_dpi())/
|
||||
((double) monitors[0].mon_unscaled_size_x);
|
||||
|
||||
if (mul)
|
||||
x *= ratio;
|
||||
@@ -181,7 +185,11 @@ mouse_scale_coord_x(double x, int mul)
|
||||
static double
|
||||
mouse_scale_coord_y(double y, int mul)
|
||||
{
|
||||
double ratio = (double) monitors[0].mon_efscrnsz_y / (double) monitors[0].mon_res_y;
|
||||
double ratio = 1.0;
|
||||
|
||||
if (!mouse_raw)
|
||||
ratio = (monitors[0].mon_res_y * plat_get_dpi()) /
|
||||
((double) monitors[0].mon_efscrnsz_y);
|
||||
|
||||
if (mul)
|
||||
y *= ratio;
|
||||
@@ -386,6 +394,8 @@ mouse_scale_y(int y)
|
||||
void
|
||||
mouse_scale(int x, int y)
|
||||
{
|
||||
pclog("DPI = %lf (%lfx%lf)\n", plat_get_dpi(), monitors[0].mon_res_x, monitors[0].mon_res_y);
|
||||
|
||||
mouse_scale_x(x);
|
||||
mouse_scale_y(y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user