Skip to content

Commit d6cfc73

Browse files
Lubrsiawesomekling
authored andcommitted
LibWeb: Expose MouseEvent.{screenX,screenY}
These are currently the same as clientX and clientY, but it works for now.
1 parent a569d02 commit d6cfc73

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Userland/Libraries/LibWeb/UIEvents/MouseEvent.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ class MouseEvent : public UIEvent {
3737
double client_x() const { return m_client_x; }
3838
double client_y() const { return m_client_y; }
3939

40+
// FIXME: Make these actually different from clientX and clientY.
41+
double screen_x() const { return m_client_x; }
42+
double screen_y() const { return m_client_y; }
43+
4044
double x() const { return client_x(); }
4145
double y() const { return client_y(); }
4246

Userland/Libraries/LibWeb/UIEvents/MouseEvent.idl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ interface MouseEvent : UIEvent {
66
readonly attribute double offsetY;
77
readonly attribute double clientX;
88
readonly attribute double clientY;
9+
readonly attribute double screenX;
10+
readonly attribute double screenY;
911
readonly attribute double x;
1012
readonly attribute double y;
1113

@@ -23,4 +25,4 @@ dictionary MouseEventInit : EventModifierInit {
2325

2426
short button = 0;
2527

26-
};
28+
};

0 commit comments

Comments
 (0)