From 2d64a76c500945e1fd95b73de70ff65a0cbaf9a6 Mon Sep 17 00:00:00 2001 From: Tanasart <22589759+Ttanasart-pt@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:09:06 +0700 Subject: [PATCH] mac mouse fix --- objects/_p_dialog/Create_0.gml | 10 ++++++++++ objects/o_dialog_menubox/Draw_64.gml | 3 ++- objects/o_main/Step_1.gml | 3 ++- scripts/winwin_utils/winwin_utils.gml | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/objects/_p_dialog/Create_0.gml b/objects/_p_dialog/Create_0.gml index 43ffb07a1..c6c37a6d2 100644 --- a/objects/_p_dialog/Create_0.gml +++ b/objects/_p_dialog/Create_0.gml @@ -255,6 +255,11 @@ var mx = raw_x - winwin_get_x_safe(window); var my = raw_y - winwin_get_y_safe(window); + if(MAC) { + mx = raw_x; + my = raw_y; + } + var _r = dialog_resizable * 6; var x0 = dialog_x - _r; var x1 = dialog_x + dialog_w + _r; @@ -272,6 +277,11 @@ var _mx = FILE_IS_DROPPING? FILE_DROPPING_X : mouse_raw_x; var _my = FILE_IS_DROPPING? FILE_DROPPING_Y : mouse_raw_y; + if(MAC) { + _mx = mouse_mx; + _my = mouse_my; + } + if(point_in(_mx, _my)) { if(depth < DIALOG_DEPTH_HOVER) { DIALOG_DEPTH_HOVER = depth; diff --git a/objects/o_dialog_menubox/Draw_64.gml b/objects/o_dialog_menubox/Draw_64.gml index 6eac21373..dce0abbe3 100644 --- a/objects/o_dialog_menubox/Draw_64.gml +++ b/objects/o_dialog_menubox/Draw_64.gml @@ -47,7 +47,8 @@ DIALOG_WINCLEAR1 var cc = struct_try_get(_menuItem, "color", c_white); var _key = _menuItem.hotkey != noone? find_hotkey(_menuItem.hotkey[0], _menuItem.hotkey[1]) : noone; _menuItem.hoykeyObject = _key; - + + //print($"{i}: {sHOVER} && {point_in_rectangle(mouse_mx, mouse_my, dialog_x, yy + 1, dialog_x + dialog_w, yy + _h - 1)}") if(sHOVER && point_in_rectangle(mouse_mx, mouse_my, dialog_x, yy + 1, dialog_x + dialog_w, yy + _h - 1)) { selecting = i; var tips = array_safe_get_fast(tooltips, i, noone); diff --git a/objects/o_main/Step_1.gml b/objects/o_main/Step_1.gml index 9d97e02aa..69e802d8c 100644 --- a/objects/o_main/Step_1.gml +++ b/objects/o_main/Step_1.gml @@ -288,4 +288,5 @@ _FILE_DROPPED = false; #endregion //if(global.cache_call) print($"CACHE called: {global.cache_call} | hit: {global.cache_hit} ({global.cache_hit / global.cache_call * 100}%)"); -// print($"{is_struct(HOVER)? instanceof(HOVER) : HOVER}, {is_struct(FOCUS)? instanceof(FOCUS) : FOCUS}"); \ No newline at end of file +print($"{is_struct(HOVER)? instanceof(HOVER) : HOVER}, {is_struct(FOCUS)? instanceof(FOCUS) : FOCUS}"); +//print($"{mouse_mx}, {mouse_my}"); \ No newline at end of file diff --git a/scripts/winwin_utils/winwin_utils.gml b/scripts/winwin_utils/winwin_utils.gml index f1ba0ad0a..e1722f1dc 100644 --- a/scripts/winwin_utils/winwin_utils.gml +++ b/scripts/winwin_utils/winwin_utils.gml @@ -17,7 +17,7 @@ function winwin_config() constructor { static owner = undefined; } -#macro __ww_valid (ww != noone && winwin_exists(ww)) +#macro __ww_valid (OS == os_windows && ww != noone && winwin_exists(ww)) function winwin_create_ext(_x, _y, _w, _h, _conf) { var window = winwin_create(_x, _y, _w, _h, _conf);