mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
tform: Change MouseWatcher::get_mouse()
to return copy of LPoint2
Instead of a reference, which is very unintuitive and a common stumbling block for comparisons
This commit is contained in:
parent
592f2b7d6e
commit
76b9df0e53
@ -34,12 +34,9 @@ is_mouse_open() const {
|
|||||||
* It is only valid to call this if has_mouse() returns true. If so, this
|
* It is only valid to call this if has_mouse() returns true. If so, this
|
||||||
* returns the current position of the mouse within the window.
|
* returns the current position of the mouse within the window.
|
||||||
*/
|
*/
|
||||||
INLINE const LPoint2 &MouseWatcher::
|
INLINE LPoint2 MouseWatcher::
|
||||||
get_mouse() const {
|
get_mouse() const {
|
||||||
#ifndef NDEBUG
|
nassertr(_has_mouse, LPoint2(0, 0));
|
||||||
static LPoint2 bogus_mouse(0.0f, 0.0f);
|
|
||||||
nassertr(_has_mouse, bogus_mouse);
|
|
||||||
#endif
|
|
||||||
return _mouse;
|
return _mouse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ PUBLISHED:
|
|||||||
|
|
||||||
INLINE bool has_mouse() const;
|
INLINE bool has_mouse() const;
|
||||||
INLINE bool is_mouse_open() const;
|
INLINE bool is_mouse_open() const;
|
||||||
INLINE const LPoint2 &get_mouse() const;
|
INLINE LPoint2 get_mouse() const;
|
||||||
INLINE PN_stdfloat get_mouse_x() const;
|
INLINE PN_stdfloat get_mouse_x() const;
|
||||||
INLINE PN_stdfloat get_mouse_y() const;
|
INLINE PN_stdfloat get_mouse_y() const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user