hermet pushed a commit to branch master.

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

commit f0f7e2dfffabb29c15c98fad6c29f558f9cecd8e
Author: Taehyub Kim <[email protected]>
Date:   Mon May 23 13:49:41 2016 +0900

    live_edit: fix the live edit item moving issue
    
    Summary:
    if we move a live edit item by direction key, sometimes pixel is increased 
by 2 pixels.
    so I modified it is increaed by 1 pixed when the scale is larger than 1.0
    
    Test Plan:
    1. launch enventor
    2. click a live edit item using toolbar
    3. move the live edit item by direction key
    4. check the change of pixel info
    
    @T3473
    
    Reviewers: Jaehyun_Cho, NikaWhite, Hermet
    
    Differential Revision: https://phab.enlightenment.org/D3946
---
 src/bin/live_edit.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/bin/live_edit.c b/src/bin/live_edit.c
index 3ea5224..48d2a66 100644
--- a/src/bin/live_edit.c
+++ b/src/bin/live_edit.c
@@ -247,40 +247,40 @@ info_text_update(live_data *ld)
    Evas_Coord lx, ly, lw, lh;
    evas_object_geometry_get(ld->live_view, &lx, &ly, &lw, &lh);
 
+   Evas_Coord vw, vh;
+   config_view_size_get(&vw, &vh);
+
    Enventor_Object *enventor = base_enventor_get();
 
    //reverse coordinates if mirror mode is enabled.
    double ox = ld->rel_info.rel1_x;
    double ox2 = ld->rel_info.rel2_x;
-   double ow = (ld->rel_info.rel1_x * (double) lw);
-   double ow2 = (ld->rel_info.rel2_x * (double) lw);
+   double ow = (ld->rel_info.rel1_x * (double) vw);
+   double ow2 = (ld->rel_info.rel2_x * (double) vw);
 
    if (enventor_object_mirror_mode_get(enventor))
      {
         ox = 1 - ox;
         ox2 = 1 - ox2;
-        ow = lw - ow;
-        ow2 = lw - ow2;
+        ow = vw - ow;
+        ow2 = vw - ow2;
      }
 
    //Rel1
    snprintf(buf, sizeof(buf), "%.2f %.2f (%d, %d)",
             ox, ld->rel_info.rel1_y,
             (int) round(ow),
-            (int) round(ld->rel_info.rel1_y * (double) lh));
+            (int) round(ld->rel_info.rel1_y * (double) vh));
    evas_object_text_text_set(ld->info_text[Info_Text_Rel1], buf);
 
    //Rel2
    snprintf(buf, sizeof(buf), "%.2f %.2f (%d, %d)",
             ox2, ld->rel_info.rel2_y,
             (int) round(ow2),
-            (int) round(ld->rel_info.rel2_y * (double) lh));
+            (int) round(ld->rel_info.rel2_y * (double) vh));
    evas_object_text_text_set(ld->info_text[Info_Text_Rel2], buf);
 
    //Size
-   Evas_Coord vw, vh;
-   config_view_size_get(&vw, &vh);
-
    vw = (Evas_Coord) (((double) vw) *
                       (ld->rel_info.rel2_x - ld->rel_info.rel1_x));
    vh = (Evas_Coord) (((double) vh) *

-- 


Reply via email to