From 1b1cf30ab569d592ac977f6d037e78025db58e98 Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Mon, 10 Aug 2015 11:28:00 +0900 Subject: [PATCH] Demo: apply transform_set when drags mouse (pressed and moved) Change-Id: I31d7f51b2bbd60a9a0f0a32ec0ae7c76fbe6a933 Signed-off-by: Duna Oh --- src/bin/e_comp_wl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index fca3742..5ba8f97 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -75,6 +75,7 @@ _e_comp_wl_transform_set(E_Client *ec) sy = ec->comp_data->transform.sy; dx = ec->comp_data->transform.dx; dy = ec->comp_data->transform.dy; + DBG("TRANSFORM s:%d,%d, d:%d,%d", sx, sy, dx, dy); orig_map = evas_object_map_get(ec->frame); if (!orig_map) @@ -566,6 +567,11 @@ _e_comp_wl_evas_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o { e_comp->wl_comp_data->ptr.x = wl_fixed_from_int(ev->cur.output.x); e_comp->wl_comp_data->ptr.y = wl_fixed_from_int(ev->cur.output.y); + ec->comp_data->transform.sx = ev->prev.output.x; + ec->comp_data->transform.sy = ev->prev.output.y; + ec->comp_data->transform.dx = ev->cur.output.x; + ec->comp_data->transform.dy = ev->cur.output.y; + _e_comp_wl_transform_set(ec); return; } if (ec->comp_data->transform.enabled) @@ -636,8 +642,6 @@ _e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t b 40, 40)) { ec->comp_data->transform.start = 1; - ec->comp_data->transform.sx = ec->mouse.current.mx; - ec->comp_data->transform.sy = ec->mouse.current.my; DBG("TRANSFORM start %d,%d", ec->comp_data->transform.sx, ec->comp_data->transform.sy); @@ -650,12 +654,8 @@ _e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t b { if (ec->comp_data->transform.start) { - ec->comp_data->transform.dx = wl_fixed_to_int(ec->comp->wl_comp_data->ptr.x); - ec->comp_data->transform.dy = wl_fixed_to_int(ec->comp->wl_comp_data->ptr.y); - DBG("TRANSFORM end %d,%d", ec->comp_data->transform.dx, ec->comp_data->transform.dy); - _e_comp_wl_transform_set(ec); ec->comp_data->transform.start = 0; return EINA_FALSE; } -- 2.7.4