diff options
Diffstat (limited to 'src/win.c')
-rw-r--r-- | src/win.c | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -482,14 +482,14 @@ handleConfigure(PuglView* view, PuglEvent* event) const LONG width = rect.right - rect.left; const LONG height = rect.bottom - rect.top; - view->frame.x = rect.left; - view->frame.y = rect.top; + view->frame.x = (PuglCoord)rect.left; + view->frame.y = (PuglCoord)rect.top; event->configure.type = PUGL_CONFIGURE; - event->configure.x = view->frame.x; - event->configure.y = view->frame.y; - event->configure.width = width; - event->configure.height = height; + event->configure.x = (PuglCoord)view->frame.x; + event->configure.y = (PuglCoord)view->frame.y; + event->configure.width = (PuglSpan)width; + event->configure.height = (PuglSpan)height; return rect; } @@ -638,10 +638,10 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) case WM_PAINT: GetUpdateRect(view->impl->hwnd, &rect, false); event.expose.type = PUGL_EXPOSE; - event.expose.x = rect.left; - event.expose.y = rect.top; - event.expose.width = rect.right - rect.left; - event.expose.height = rect.bottom - rect.top; + event.expose.x = (PuglCoord)rect.left; + event.expose.y = (PuglCoord)rect.top; + event.expose.width = (PuglSpan)(rect.right - rect.left); + event.expose.height = (PuglSpan)(rect.bottom - rect.top); break; case WM_ERASEBKGND: return true; @@ -1200,8 +1200,9 @@ puglWinCreateWindow(PuglView* const view, view->frame.width = defaultSize.width; view->frame.height = defaultSize.height; - view->frame.x = (screenWidth - view->frame.width) / 2.0; - view->frame.y = (screenHeight - view->frame.height) / 2.0; + + view->frame.x = (PuglCoord)((screenWidth - view->frame.width) / 2); + view->frame.y = (PuglCoord)((screenHeight - view->frame.height) / 2); } // The meaning of "parent" depends on the window type (WS_CHILD) |