]> git.saurik.com Git - wxWidgets.git/commitdiff
don't cast from float to int (provoking a warning) just to cast back to float again
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Nov 2005 15:19:12 +0000 (15:19 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Nov 2005 15:19:12 +0000 (15:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36208 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/dccg.cpp

index 67375d25db458ab5968c4108ee6b539f2398e4e8..b75b1288c3c39e59917823fcf1f578bf38e5d007 100755 (executable)
@@ -560,7 +560,7 @@ void wxMacCGContext::SetPen( const wxPen &pen )
             const float *lengths = NULL ;
             float *userLengths = NULL ;
 
-            int dashUnit = ( penWidth < 1.0 ) ? 1.0 : penWidth;
+            const float dashUnit = penWidth < 1.0 ? 1.0 : penWidth;
   
             const float dotted[] = { dashUnit  , dashUnit + 2.0 };
             const float short_dashed[] = { 9.0 , 6.0 };
@@ -596,7 +596,7 @@ void wxMacCGContext::SetPen( const wxPen &pen )
                         userLengths = new float[count] ;
                         for( int i = 0 ; i < count ; ++i )
                         {
-                            userLengths[i] = (float)dashes[i] * dashUnit ;
+                            userLengths[i] = dashes[i] * dashUnit ;
 
                             if ( i % 2 == 1 && userLengths[i] < dashUnit + 2.0 )
                                 userLengths[i] = dashUnit + 2.0 ;