mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 20:06:18 +08:00
Windows: avoid crash when resizing window containing non-FLTK child window (#1401)
This commit is contained in:
+2
-2
@@ -1213,12 +1213,12 @@ static void invalidate_gl_win(Fl_Window *glwin) {
|
|||||||
|
|
||||||
static BOOL CALLBACK child_window_cb(HWND child_xid, LPARAM data) {
|
static BOOL CALLBACK child_window_cb(HWND child_xid, LPARAM data) {
|
||||||
Fl_Window *child = fl_find(child_xid);
|
Fl_Window *child = fl_find(child_xid);
|
||||||
if (data) {
|
if (child && data) {
|
||||||
float s = *(float*)data;
|
float s = *(float*)data;
|
||||||
SetWindowPos(child_xid, 0, int(round(child->x() * s)), int(round(child->y() * s)),
|
SetWindowPos(child_xid, 0, int(round(child->x() * s)), int(round(child->y() * s)),
|
||||||
int(round(child->w() * s)), int(round(child->h() * s)), 0);
|
int(round(child->w() * s)), int(round(child->h() * s)), 0);
|
||||||
}
|
}
|
||||||
if (child->as_gl_window()) invalidate_gl_win(child);
|
if (child && child->as_gl_window()) invalidate_gl_win(child);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user