mac mouse fix

This commit is contained in:
Tanasart 2024-09-17 10:09:06 +07:00
parent a1a1e36b49
commit 2d64a76c50
4 changed files with 15 additions and 3 deletions

View file

@ -255,6 +255,11 @@
var mx = raw_x - winwin_get_x_safe(window); var mx = raw_x - winwin_get_x_safe(window);
var my = raw_y - winwin_get_y_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 _r = dialog_resizable * 6;
var x0 = dialog_x - _r; var x0 = dialog_x - _r;
var x1 = dialog_x + dialog_w + _r; var x1 = dialog_x + dialog_w + _r;
@ -272,6 +277,11 @@
var _mx = FILE_IS_DROPPING? FILE_DROPPING_X : mouse_raw_x; var _mx = FILE_IS_DROPPING? FILE_DROPPING_X : mouse_raw_x;
var _my = FILE_IS_DROPPING? FILE_DROPPING_Y : mouse_raw_y; 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(point_in(_mx, _my)) {
if(depth < DIALOG_DEPTH_HOVER) { if(depth < DIALOG_DEPTH_HOVER) {
DIALOG_DEPTH_HOVER = depth; DIALOG_DEPTH_HOVER = depth;

View file

@ -48,6 +48,7 @@ DIALOG_WINCLEAR1
var _key = _menuItem.hotkey != noone? find_hotkey(_menuItem.hotkey[0], _menuItem.hotkey[1]) : noone; var _key = _menuItem.hotkey != noone? find_hotkey(_menuItem.hotkey[0], _menuItem.hotkey[1]) : noone;
_menuItem.hoykeyObject = _key; _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)) { if(sHOVER && point_in_rectangle(mouse_mx, mouse_my, dialog_x, yy + 1, dialog_x + dialog_w, yy + _h - 1)) {
selecting = i; selecting = i;
var tips = array_safe_get_fast(tooltips, i, noone); var tips = array_safe_get_fast(tooltips, i, noone);

View file

@ -288,4 +288,5 @@ _FILE_DROPPED = false;
#endregion #endregion
//if(global.cache_call) print($"CACHE called: {global.cache_call} | hit: {global.cache_hit} ({global.cache_hit / global.cache_call * 100}%)"); //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}"); print($"{is_struct(HOVER)? instanceof(HOVER) : HOVER}, {is_struct(FOCUS)? instanceof(FOCUS) : FOCUS}");
//print($"{mouse_mx}, {mouse_my}");

View file

@ -17,7 +17,7 @@ function winwin_config() constructor {
static owner = undefined; 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) { function winwin_create_ext(_x, _y, _w, _h, _conf) {
var window = winwin_create(_x, _y, _w, _h, _conf); var window = winwin_create(_x, _y, _w, _h, _conf);