Skip to content

Commit

Permalink
webasm fix resize event
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Jul 16, 2024
1 parent f147eb0 commit d3073e4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ extern "C" {
RGFW_Event.axisCount says how many axis there are
*/
#define RGFW_windowMoved 10 /*!< the window was moved (by the user) */
#define RGFW_windowResized 11 /*!< the window was resized (by the user) */
#define RGFW_windowResized 11 /*!< the window was resized (by the user), [on webASM this means the browser was resized] */

#define RGFW_focusIn 12 /*!< window is in focus now */
#define RGFW_focusOut 13 /*!< window is out of focus now */
Expand Down Expand Up @@ -6756,8 +6756,7 @@ EM_BOOL on_resize(int eventType, const EmscriptenUiEvent* e, void* userData) {
RGFW_events[RGFW_eventLen].type = RGFW_windowResized;
RGFW_eventLen++;

RGFW_root->r = RGFW_RECT(0, 0, e->windowInnerWidth, e->windowInnerHeight);
RGFW_windowResizeCallback(RGFW_root, RGFW_root->r);
RGFW_windowResizeCallback(RGFW_root, RGFW_RECT(e->windowInnerWidth, e->windowInnerHeight));
return EM_TRUE;
}

Expand Down

0 comments on commit d3073e4

Please sign in to comment.