mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 10:35:43 -05:00
OSX prefers scroll be implemented this way.
This commit is contained in:
parent
6b7739660c
commit
9a23cf7b42
1 changed files with 7 additions and 3 deletions
|
@ -77,7 +77,8 @@ namespace entry
|
|||
struct Context
|
||||
{
|
||||
Context()
|
||||
: m_scroll(0)
|
||||
: m_scrollf(0.0f)
|
||||
, m_scroll(0)
|
||||
, m_exit(false)
|
||||
{
|
||||
s_translateKey[27] = Key::Esc;
|
||||
|
@ -292,9 +293,11 @@ namespace entry
|
|||
|
||||
case NSScrollWheel:
|
||||
{
|
||||
m_scrollf += [event deltaY];
|
||||
|
||||
int x, y;
|
||||
getMousePos(&x, &y);
|
||||
m_scroll += ([event deltaY] > 0.0f) ? 1 : -1;
|
||||
m_scroll = (int32_t)m_scrollf;
|
||||
m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll);
|
||||
break;
|
||||
}
|
||||
|
@ -443,6 +446,7 @@ namespace entry
|
|||
bx::HandleAllocT<ENTRY_CONFIG_MAX_WINDOWS> m_windowAlloc;
|
||||
NSWindow* m_window[ENTRY_CONFIG_MAX_WINDOWS];
|
||||
|
||||
float m_scrollf;
|
||||
int32_t m_scroll;
|
||||
bool m_exit;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue