Added ignoreEvent boolean to Mouse::SetPosition
Former-commit-id: 6dcb701a51c7bc58b105dd42f7ad44371fd0c92b
This commit is contained in:
parent
b2318b5261
commit
9ee273f550
|
|
@ -32,9 +32,9 @@ class NAZARA_API NzMouse
|
|||
static NzVector2i GetPosition(const NzWindow& relativeTo);
|
||||
static bool IsButtonPressed(Button button);
|
||||
static void SetPosition(const NzVector2i& position);
|
||||
static void SetPosition(const NzVector2i& position, const NzWindow& relativeTo);
|
||||
static void SetPosition(const NzVector2i& position, const NzWindow& relativeTo, bool ignoreEvent = true);
|
||||
static void SetPosition(int x, int y);
|
||||
static void SetPosition(int x, int y, const NzWindow& relativeTo);
|
||||
static void SetPosition(int x, int y, const NzWindow& relativeTo, bool ignoreEvent = true);
|
||||
};
|
||||
|
||||
#endif // NAZARA_MOUSE_HPP
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ void NzMouse::SetPosition(const NzVector2i& position)
|
|||
NzEventImpl::SetMousePosition(position.x, position.y);
|
||||
}
|
||||
|
||||
void NzMouse::SetPosition(const NzVector2i& position, const NzWindow& relativeTo)
|
||||
void NzMouse::SetPosition(const NzVector2i& position, const NzWindow& relativeTo, bool ignoreEvent)
|
||||
{
|
||||
if (position.x > 0 && position.y > 0)
|
||||
if (ignoreEvent && position.x > 0 && position.y > 0)
|
||||
relativeTo.IgnoreNextMouseEvent(position.x, position.y);
|
||||
|
||||
NzEventImpl::SetMousePosition(position.x, position.y, relativeTo);
|
||||
|
|
@ -48,9 +48,9 @@ void NzMouse::SetPosition(int x, int y)
|
|||
NzEventImpl::SetMousePosition(x, y);
|
||||
}
|
||||
|
||||
void NzMouse::SetPosition(int x, int y, const NzWindow& relativeTo)
|
||||
void NzMouse::SetPosition(int x, int y, const NzWindow& relativeTo, bool ignoreEvent)
|
||||
{
|
||||
if (x > 0 && y > 0)
|
||||
if (ignoreEvent && x > 0 && y > 0)
|
||||
relativeTo.IgnoreNextMouseEvent(x, y);
|
||||
|
||||
NzEventImpl::SetMousePosition(x, y, relativeTo);
|
||||
|
|
|
|||
Loading…
Reference in New Issue