Skip to content

Commit 1fb12d1

Browse files
[[ Bug 13675 ]] Scrollbar for the font selection in the script editor preferences doesn't work
1 parent 3db1536 commit 1fb12d1

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

docs/notes/bugfix-13675.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Scrollbar for the font selection in the script editor preferences doesn't work

engine/src/button.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,8 +1136,17 @@ Boolean MCButton::mdown(uint2 which)
11361136
{
11371137
// SN-2014-08-26: [[ Bug 13201 ]] mx/my are now related to the button's rectangle,
11381138
// not the stack's rectangle anymore.
1139-
if (state & CS_SCROLLBAR && mx > rect.width - MCscrollbarwidth
1140-
&& mx < rect.width)
1139+
// SN-2014-10-17: [[ Bug 13675 ]] mx/my refer to the button's rectangle on Mac only
1140+
int2 t_right_limit, t_left_limit;
1141+
#ifdef _MACOSX
1142+
t_left_limit = rect.width - MCscrollbarwidth;
1143+
t_right_limit = rect.width;
1144+
#else
1145+
t_left_limit = rect.x + rect.width - MCscrollbarwidth;
1146+
t_right_limit = rect.x + rect.width;
1147+
#endif
1148+
if (state & CS_SCROLLBAR && mx > t_left_limit
1149+
&& mx < t_right_limit)
11411150
{
11421151
menu->mdown(which);
11431152
state |= CS_FIELD_GRAB;
@@ -4723,4 +4732,4 @@ IO_stat MCButton::load(IO_handle stream, const char *version)
47234732
}
47244733
}
47254734
return IO_NORMAL;
4726-
}
4735+
}

0 commit comments

Comments
 (0)