diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/PlatWin.cxx | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index c1cd38f71..f7d68b921 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -2462,20 +2462,22 @@ void ListBoxX::Draw(DRAWITEMSTRUCT *pDrawItem) { ); ID2D1DCRenderTarget *pDCRT = 0; HRESULT hr = pD2DFactory->CreateDCRenderTarget(&props, &pDCRT); - RECT rcWindow; - GetClientRect(pDrawItem->hwndItem, &rcWindow); - hr = pDCRT->BindDC(pDrawItem->hDC, &rcWindow); if (SUCCEEDED(hr)) { - surfaceItem->Init(pDCRT, pDrawItem->hwndItem); - pDCRT->BeginDraw(); - int left = pDrawItem->rcItem.left + ItemInset.x + ImageInset.x; - PRectangle rcImage(left, pDrawItem->rcItem.top, - left + images.GetWidth(), pDrawItem->rcItem.bottom); - surfaceItem->DrawRGBAImage(rcImage, - pimage->GetWidth(), pimage->GetHeight(), pimage->Pixels()); - delete surfaceItem; - pDCRT->EndDraw(); - pDCRT->Release(); + RECT rcWindow; + GetClientRect(pDrawItem->hwndItem, &rcWindow); + hr = pDCRT->BindDC(pDrawItem->hDC, &rcWindow); + if (SUCCEEDED(hr)) { + surfaceItem->Init(pDCRT, pDrawItem->hwndItem); + pDCRT->BeginDraw(); + int left = pDrawItem->rcItem.left + ItemInset.x + ImageInset.x; + PRectangle rcImage(left, pDrawItem->rcItem.top, + left + images.GetWidth(), pDrawItem->rcItem.bottom); + surfaceItem->DrawRGBAImage(rcImage, + pimage->GetWidth(), pimage->GetHeight(), pimage->Pixels()); + delete surfaceItem; + pDCRT->EndDraw(); + pDCRT->Release(); + } } #endif } |