]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/dcclient.cpp
fix bug with adding entries to a root group containing only subgroups (as shown by...
[wxWidgets.git] / src / x11 / dcclient.cpp
index 291b93b268d5e2a22f21fdade45005daab34e701..63932ca5b9fcdd39fdf448635278518465690cf8 100644 (file)
@@ -41,7 +41,8 @@
 // local defines
 //-----------------------------------------------------------------------------
 
-#define USE_PAINT_REGION 1
+// VZ: what is this for exactly??
+#define USE_PAINT_REGION 0
 
 //-----------------------------------------------------------------------------
 // local data
@@ -1276,8 +1277,8 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
     if (!m_window) return false;
 
     // transform the source DC coords to the device ones
-    xsrc = source->XLOG2DEV(xsrc);
-    ysrc = source->YLOG2DEV(ysrc);
+    xsrc = source->LogicalToDeviceX(xsrc);
+    ysrc = source->LogicalToDeviceY(ysrc);
 
     wxClientDC *srcDC = (wxClientDC*)source;
     wxMemoryDC *memDC = (wxMemoryDC*)source;
@@ -1563,7 +1564,7 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
         slen = strlen(text);
         XCharStruct overall_return;
 
-        (void)XTextExtents(xfont, (char*) text.c_str(), slen, &direction,
+        (void)XTextExtents(xfont, (const char*) text.c_str(), slen, &direction,
                                  &ascent, &descent, &overall_return);
 
         cx = overall_return.width;
@@ -1612,7 +1613,7 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y,
 
 void wxWindowDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
                                 wxCoord *descent, wxCoord *externalLeading,
-                                wxFont *font ) const
+                                const wxFont *font ) const
 {
     wxCHECK_RET( Ok(), wxT("invalid dc") );
 
@@ -1661,7 +1662,7 @@ void wxWindowDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoor
     int direction, ascent, descent2;
     XCharStruct overall;
 
-    XTextExtents( xfont, (char*) string.c_str(), string.length(), &direction,
+    XTextExtents( xfont, (const char*) string.c_str(), string.length(), &direction,
         &ascent, &descent2, &overall);
 
     if (width)
@@ -2171,13 +2172,13 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoo
     rect.width = XLOG2DEVREL(width);
     rect.height = YLOG2DEVREL(height);
 
-    if (!m_currentClippingRegion.IsNull())
+    if (!m_currentClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( rect );
     else
-        m_currentClippingRegion.Union( rect );
+        m_currentClippingRegion = rect;
 
 #if USE_PAINT_REGION
-    if (!m_paintClippingRegion.IsNull())
+    if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( m_paintClippingRegion );
 #endif
 
@@ -2203,13 +2204,13 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion& region )
 
     if (!m_window) return;
 
-    if (!m_currentClippingRegion.IsNull())
+    if (!m_currentClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( region );
     else
-        m_currentClippingRegion.Union( region );
+        m_currentClippingRegion = region;
 
 #if USE_PAINT_REGION
-    if (!m_paintClippingRegion.IsNull())
+    if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( m_paintClippingRegion );
 #endif