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
This commit is contained in:
Taehyub Kim 2016-05-23 13:49:41 +09:00 committed by Hermet Park
parent 519bcbedee
commit f0f7e2dfff
1 changed files with 9 additions and 9 deletions

View File

@ -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) *