Skip to content

Commit

Permalink
Fix GetDisplaySize
Browse files Browse the repository at this point in the history
  • Loading branch information
user-grinch committed Jun 22, 2024
1 parent bde6d6d commit 3c422de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/opcodemgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,11 @@ static RTN_TYPE RUNTIME_API ImGuiGetWindowSize(RUNTIME_CONTEXT ctx) {

static RTN_TYPE RUNTIME_API ImGuiGetDisplaySize(RUNTIME_CONTEXT ctx) {
ScriptExData* data = ScriptExData::Get();
MONITORINFO info = {sizeof(info)};
GetMonitorInfo(MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY), &info);
RECT rect;
GetClientRect(GetForegroundWindow(), &rect);

wSetFloatParam(ctx, info.rcMonitor.right - info.rcMonitor.left);
wSetFloatParam(ctx, info.rcMonitor.bottom - info.rcMonitor.top);
wSetFloatParam(ctx, rect.right - rect.left);
wSetFloatParam(ctx, rect.bottom - rect.top);
return RTN_CONTINUE;
}

Expand Down

0 comments on commit 3c422de

Please sign in to comment.