]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/graphics.cpp
use const for xpm icons
[wxWidgets.git] / src / msw / graphics.cpp
index f6eb219ca72ac01acbcd6946c3f24d2c733b995a..c7489e54a3d6e1f2dbbcc46b933013a423ccde9e 100644 (file)
@@ -668,7 +668,7 @@ void wxGDIPlusPathData::GetCurrentPoint( wxDouble* x, wxDouble* y) const
 void wxGDIPlusPathData::AddArc( wxDouble x, wxDouble y, wxDouble r, double startAngle, double endAngle, bool clockwise )
 {
     double sweepAngle = endAngle - startAngle ;
-    if( abs(sweepAngle) >= 2*M_PI)
+    if( fabs(sweepAngle) >= 2*M_PI)
     {
         sweepAngle = 2 * M_PI;
     }
@@ -1043,7 +1043,7 @@ void wxGDIPlusContext::DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y,
                 helper->GetPixelFormat(),&data);
 
             image = new Bitmap(data.Width, data.Height, data.Stride,
-                PixelFormat32bppARGB , (BYTE*) data.Scan0);
+                PixelFormat32bppPARGB , (BYTE*) data.Scan0);
 
             helper->UnlockBits(&data);
         }
@@ -1123,11 +1123,11 @@ void wxGDIPlusContext::GetTextExtent( const wxString &str, wxDouble *width, wxDo
         f->GetSize() / ffamily.GetEmHeight(FontStyleRegular);
 
     if ( height )
-        *height = rHeight * factorY + 0.5 ;
+        *height = rHeight * factorY;
     if ( descent )
-        *descent = rDescent * factorY + 0.5 ;
+        *descent = rDescent * factorY;
     if ( externalLeading )
-        *externalLeading = (rHeight - rAscent - rDescent) * factorY + 0.5 ;
+        *externalLeading = (rHeight - rAscent - rDescent) * factorY;
     // measuring empty strings is not guaranteed, so do it by hand
     if ( str.IsEmpty())
     {
@@ -1142,12 +1142,14 @@ void wxGDIPlusContext::GetTextExtent( const wxString &str, wxDouble *width, wxDo
         StringFormat strFormat;
         CharacterRange strRange(0,wcslen(s));
         strFormat.SetMeasurableCharacterRanges(1,&strRange);
+        strFormat.SetFormatFlags(StringFormatFlagsMeasureTrailingSpaces);
+
         Region region ;
         m_context->MeasureCharacterRanges(s, -1 , f,layoutRect, &strFormat,1,&region) ;
         RectF bbox ;
         region.GetBounds(&bbox,m_context);
         if ( width )
-            *width = bbox.GetRight()-bbox.GetLeft()+0.5;
+            *width = bbox.GetRight()-bbox.GetLeft();
     }
 }
 
@@ -1176,6 +1178,7 @@ void wxGDIPlusContext::GetPartialTextExtents(const wxString& text, wxArrayDouble
         ranges[i].Length = 1 ;
     }
     strFormat.SetMeasurableCharacterRanges(len,ranges);
+    strFormat.SetFormatFlags(StringFormatFlagsMeasureTrailingSpaces);
     m_context->MeasureCharacterRanges(ws, -1 , f,layoutRect, &strFormat,1,regions) ;
 
     RectF bbox ;