jaehyun pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=675990ad3f81b516a925f54f5f5f261fb6c62d56

commit 675990ad3f81b516a925f54f5f5f261fb6c62d56
Author: Jaehyun Cho <[email protected]>
Date:   Fri Aug 19 16:28:58 2016 +0900

    live_edit: Apply round-off to view size and min size calculation.
    
    To compute accurate view size and min size, apply round-off to view size
    and min size calculation.
---
 src/bin/live_edit.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/bin/live_edit.c b/src/bin/live_edit.c
index caab8fe..f1830fc 100644
--- a/src/bin/live_edit.c
+++ b/src/bin/live_edit.c
@@ -295,10 +295,10 @@ info_text_update(live_data *ld)
    evas_object_text_text_set(ld->info_text[Info_Text_Rel2], buf);
 
    //Size
-   vw = (Evas_Coord) (((double) vw) *
-                      (ld->rel_info.rel2_x - ld->rel_info.rel1_x));
-   vh = (Evas_Coord) (((double) vh) *
-                      (ld->rel_info.rel2_y - ld->rel_info.rel1_y));
+   vw = (Evas_Coord) round(((double) vw) *
+                           (ld->rel_info.rel2_x - ld->rel_info.rel1_x));
+   vh = (Evas_Coord) round(((double) vh) *
+                           (ld->rel_info.rel2_y - ld->rel_info.rel1_y));
    snprintf(buf, sizeof(buf), "%d X %d", vw, vh);
    evas_object_text_text_set(ld->info_text[Info_Text_Size], buf);
 
@@ -378,10 +378,12 @@ calc_relative_info(live_data *ld)
    enventor_object_live_view_size_get(base_enventor_get(), &vw, &vh);
 
    //Calculate real min size of Live Edit Item base on current relative
-   Evas_Coord min_w = (Evas_Coord) (((double) vw) *
-                          (ld->rel_info.rel2_x - ld->rel_info.rel1_x));
-   Evas_Coord min_h = (Evas_Coord) (((double) vh) *
-                          (ld->rel_info.rel2_y - ld->rel_info.rel1_y));
+   Evas_Coord min_w =
+      (Evas_Coord) round(((double) vw) *
+                         (ld->rel_info.rel2_x - ld->rel_info.rel1_x));
+   Evas_Coord min_h =
+      (Evas_Coord) round(((double) vh) *
+                         (ld->rel_info.rel2_y - ld->rel_info.rel1_y));
 
    //Set fixed properties of width for current Live Edit Item
    if (fixed_w)

-- 


Reply via email to