]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxRound(x) instead of int( x+0.5 )
authorRobert Roebling <robert@roebling.de>
Thu, 8 Jan 2009 14:36:18 +0000 (14:36 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 8 Jan 2009 14:36:18 +0000 (14:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/spinctlg.h
include/wx/gtk/spinctrl.h

index bdd0d4e55e9b0e9ee392b7472c874e863a8ec88f..d01f8ba5bc32b2eaf3c5dda19a1b103aed852321 100644 (file)
@@ -247,10 +247,10 @@ public:
     }
 
     // accessors
-    int GetValue(wxSPINCTRL_GETVALUE_FIX) const { return int(DoGetValue() + 0.5); }
-    int GetMin() const       { return int(m_min + 0.5); }
-    int GetMax() const       { return int(m_max + 0.5); }
-    int GetIncrement() const { return int(m_increment + 0.5); }
+    int GetValue(wxSPINCTRL_GETVALUE_FIX) const { return wxRound( DoGetValue() ); }
+    int GetMin() const       { return wxRound( m_min ); }
+    int GetMax() const       { return wxRound( m_max ); }
+    int GetIncrement() const { return wxRound( m_increment ); }
 
     // operations
     void SetValue(const wxString& value)    { wxSpinCtrlGenericBase::SetValue(value); } // visibility problem w/ gcc
index da0fd6c8ce98e1ba1a6cfc12ffb7a77eb71ff0a7..2cc025425350880c6ae046b80b069931ae868152 100644 (file)
@@ -121,10 +121,10 @@ public:
     }
 
     // accessors
-    int GetValue() const     { return int(DoGetValue() + 0.5); }
-    int GetMin() const       { return int(DoGetMin() + 0.5); }
-    int GetMax() const       { return int(DoGetMax() + 0.5); }
-    int GetIncrement() const { return int(DoGetIncrement() + 0.5); }
+    int GetValue() const     { return wxRound( DoGetValue() ); }
+    int GetMin() const       { return wxRound( DoGetMin() ); }
+    int GetMax() const       { return wxRound( DoGetMax() ); }
+    int GetIncrement() const { return wxRound( DoGetIncrement() ); }
 
     // operations
     void SetValue(const wxString& value)    { wxSpinCtrlGTKBase::SetValue(value); } // visibility problem w/ gcc