]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/defs.h
some people disliked the asterisks in wxDebugReport dialog, removed (patch 1491869)
[wxWidgets.git] / include / wx / defs.h
index bdc630b91dcbf292b7e8463ffe980df4e9e67cd0..831f870c5ea0361f920d6f9dde725d64fa18a660 100644 (file)
@@ -658,6 +658,18 @@ typedef int wxCoord;
 
 enum {  wxDefaultCoord = -1 };
 
+/*  round-to-nearest (used in scaling) */
+#ifdef __cplusplus
+inline wxCoord wxCoordRound(const float& f)
+{
+    return (f > 0) ? (wxCoord)(f + 0.5) : (f < 0) ? (wxCoord)(f - 0.5) : 0;
+}
+inline wxCoord wxCoordRound(const double& f)
+{
+    return (f > 0) ? (wxCoord)(f + 0.5) : (f < 0) ? (wxCoord)(f - 0.5) : 0;
+}
+#endif
+
 /*  ---------------------------------------------------------------------------- */
 /*  define fixed length types */
 /*  ---------------------------------------------------------------------------- */
@@ -969,7 +981,7 @@ inline void *wxUIntToPtr(wxUIntPtr p)
         #define wxULongLong_t unsigned wxLongLong_t
     #endif
 
-    /*  these macros allow to definea 64 bit constants in a portable way */
+    /*  these macros allow to define 64 bit constants in a portable way */
     #define wxLL(x) wxCONCAT(x, wxLongLongSuffix)
     #define wxULL(x) wxCONCAT(x, wxCONCAT(u, wxLongLongSuffix))
 
@@ -979,7 +991,7 @@ inline void *wxUIntToPtr(wxUIntPtr p)
     #define wxHAS_INT64 1
 
 #elif wxUSE_LONGLONG
-    /*  these macros allow to definea 64 bit constants in a portable way */
+    /*  these macros allow to define 64 bit constants in a portable way */
     #define wxLL(x) wxLongLong(x)
     #define wxULL(x) wxULongLong(x)