]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix magic mouse positioning in some filter modes.
authorToni Wilen <twilen@winuae.net>
Sat, 20 Dec 2025 09:59:16 +0000 (11:59 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 20 Dec 2025 09:59:16 +0000 (11:59 +0200)
drawing.cpp
inputdevice.cpp
od-win32/win32_scaler.cpp

index 9cd9eb22b40577471c6516990daed47d782b1f79..7e7097e1eb6bb249c2b7c1e1fb00bbcc2720080c 100644 (file)
@@ -584,7 +584,7 @@ int coord_native_to_amiga_y(int y)
        if (y >= native2amiga_line_map_height) {
                y = native2amiga_line_map_height - 1;
        }
-       return native2amiga_line_map[y] - minfirstline;
+       return native2amiga_line_map[y];
 }
 
 void notice_screen_contents_lost(int monid)
@@ -1074,7 +1074,7 @@ void get_custom_mouse_limits (int *pw, int *ph, int *pdx, int *pdy, int dbl)
        w = diwlastword_total - diwfirstword_total;
        dx = diwfirstword_total - visible_left_border;
 
-       y2 = plflastline_total;
+       y2 = plflastline_total + 1;
        y1 = plffirstline_total;
        if (minfirstline > y1)
                y1 = minfirstline;
index 150558ea1a4996232fe1c31a0f47b8330b0449a8..e166df9fe2a45a3507afa215619c34dbd690d1a3 100644 (file)
@@ -2653,7 +2653,7 @@ static bool get_mouse_position(int *xp, int *yp, int inx, int iny)
 
        getgfxoffset(monid, &fdx, &fdy, &fmx, &fmy);
 
-       //write_log("%.2f*%.2f %.2f*%.2f\n", fdx, fdy, fmx, fmy);
+       //write_log("%d %d, %.2f*%.2f %.2f*%.2f\n", x, y, fdx, fdy, fmx, fmy);
 
 #ifdef PICASSO96
        if (ad->picasso_on) {
@@ -3353,8 +3353,6 @@ end:
                if (!ad->picasso_on) {
                        int aw = 0, ah = 0, dx, dy;
                        get_custom_mouse_limits(&aw, &ah, &dx, &dy, dimensioninfo_dbl);
-                       x += dx;
-                       y += dy;
                        float dx2, dy2, mx2, my2;
                        getgfxoffset(monid, &dx2, &dy2, &mx2, &my2);
                        if (mx2) {
@@ -3363,6 +3361,8 @@ end:
                        if (my2) {
                                y = (int)(y / my2);
                        }
+                       x += dx;
+                       y += dy;
                        x += (int)dx2;
                        y += (int)dy2;
                } else {
index a555dd26cabc63675609b3b0937dacabb7dce314..42efaa0b33b17c09a3d03d152daa2d57a13311eb 100644 (file)
@@ -616,6 +616,11 @@ void getfilterdata(int monid, struct displayscale *ds)
 
                                filteroffsetx = (float)-ds->xoffset / ds->scale;
                                filteroffsety = (float)-ds->yoffset / ds->scale;
+
+                               diff = ds->outwidth;
+                               filterxmult = ((float)ds->dstwidth * ds->scale) / diff;
+                               diff = ds->outheight;
+                               filterymult = ((float)ds->dstheight * ds->scale) / diff;
                                goto end;
                        }
 
@@ -758,8 +763,9 @@ cont:
 
        filterxmult = xmult;
        filterymult = ymult;
-       filteroffsetx += (ds->dstwidth - ds->srcwidth * filterxmult) / 2;
-       filteroffsety += (ds->dstheight - ds->srcheight * filterymult) / 2;
+
+       filteroffsetx = (float)-ds->xoffset / ds->scale;
+       filteroffsety = (float)-ds->yoffset / ds->scale;
 
 end: