MCPcopy Create free account
hub / github.com/WallBreaker2/op / MatchesTargetClientRect

Function MatchesTargetClientRect

libop/window/WindowLayout.cpp:130–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130bool MatchesTargetClientRect(HWND hwnd, const Rect &rect, const Metrics &initial_metrics) {
131 Metrics current_metrics = {};
132 if (!GetWindowMetrics(hwnd, current_metrics)) {
133 return false;
134 }
135
136 Insets insets = {};
137 GetInsets(initial_metrics, insets);
138
139 const int expected_x = rect.x + insets.left;
140 const int expected_y = rect.y + insets.top;
141 return abs(current_metrics.client_rect.x - expected_x) <= kResizeTolerance &&
142 abs(current_metrics.client_rect.y - expected_y) <= kResizeTolerance;
143}
144
145bool BuildUniformWindowRect(HWND hwnd, const Options &options, Rect &rect) {
146 RECT window_rect = {};

Callers 1

ApplyFunction · 0.85

Calls 2

GetWindowMetricsFunction · 0.85
GetInsetsFunction · 0.85

Tested by

no test coverage detected