]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/ownerdrw.cpp
Checked for stream validity in wxImage::GetImageCount.
[wxWidgets.git] / src / os2 / ownerdrw.cpp
index e5c4065ef4ac81584c834113dad50611170256bd..2cfddaec1b1460cf80aa24e07c426a1032144113 100644 (file)
@@ -18,7 +18,7 @@
 
 #ifndef WX_PRECOMP
   #include "wx/window.h"
-  #include "wx/msw/private.h"
+  #include "wx/os2/private.h"
   #include "wx/font.h"
   #include "wx/bitmap.h"
   #include "wx/dcmemory.h"
@@ -365,11 +365,10 @@ bool wxOwnerDrawn::OnDrawItem(
             //
             wxASSERT((nBmpWidth <= rRect.width) && (nBmpHeight <= rRect.height));
 
-            //
-            //MT: blit with mask enabled.
-            //
+            int                     nHeightDiff = m_nHeight - nBmpHeight;
+
             rDC.Blit( rRect.x + (GetMarginWidth() - nBmpWidth) / 2
-                     ,rRect.y + (m_nHeight - nBmpHeight) /2
+                     ,rRect.y + nHeightDiff / 2
                      ,nBmpWidth
                      ,nBmpHeight
                      ,&vDCMem
@@ -383,11 +382,12 @@ bool wxOwnerDrawn::OnDrawItem(
             {
                 RECT                vRectBmp = { rRect.x
                                                 ,rRect.y
-                                                ,rRect.x + GetMarginWidth()
-                                                ,rRect.y + m_nHeight
+                                                ,rRect.x + GetMarginWidth() - 1
+                                                ,rRect.y + m_nHeight - 1
                                                };
-                POINTL              vPnt1 = {2, 4}; // Leave a little background border
+                POINTL              vPnt1 = {rRect.x + 1, rRect.y + 3}; // Leave a little background border
                 POINTL              vPnt2 = {rRect.x + GetMarginWidth(), rRect.y + m_nHeight - 3};
+
                 LINEBUNDLE          vLine;
 
                 vLine.lColor = vColBack.GetPixel();