sclae : add the feature for rounding off 37/70237/1
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Thu, 19 May 2016 02:43:33 +0000 (11:43 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Thu, 19 May 2016 02:43:33 +0000 (11:43 +0900)
Add the feature for rounding off to the nearest in ELM_SCALE_SIZE
macro. It makes to be more close to calculated value.

Change-Id: I0ad00039da22de20fe741927da76056062e70822

src/lib/elm_macros.h

index 61b33775a57b71996e92ee21e925976ad79b8431..0ce9b6c5dbc90b8c9b76a1a75569457186f57100 100644 (file)
@@ -1,7 +1,7 @@
 /* handy macros */
 #define ELM_RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && (((x) + (w)) > (xx)) && (((y) + (h)) > (yy)))
 #define ELM_PI 3.14159265358979323846
-#define ELM_SCALE_SIZE(x) (int)(((double)(x) * elm_config_scale_get()) / elm_app_base_scale_get())
+#define ELM_SCALE_SIZE(x) ((int)(((double)(x) * elm_config_scale_get()) / elm_app_base_scale_get() + 0.5))
 
 // checks if the point(xx, yy) stays out of the rectangle(x, y, w, h) area.
 #define ELM_RECTS_POINT_OUT(x, y, w, h, xx, yy) (((xx) < (x)) || ((yy) < (y)) || ((xx) > ((x) + (w))) || ((yy) > ((y) + (h))))