From b30c872343c638762425d99518fc9b5e5cfe315b Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 7 Jul 2017 11:55:13 +0900 Subject: [PATCH] Modified magnifier window to use window geometry for floating IME Change-Id: Iead20e31d6c3c4800167d8b544846738994ad4a4 --- scl/sclcontroller.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/scl/sclcontroller.cpp b/scl/sclcontroller.cpp index f6c9324..2c79244 100644 --- a/scl/sclcontroller.cpp +++ b/scl/sclcontroller.cpp @@ -1179,30 +1179,32 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y, if (sclres_manager) { magnifier_configure = sclres_manager->get_magnifier_configure(); } - if (showMagnifier && magnifier_configure) { + + SclWindowContext *window_context = windows->get_window_context(window); + if (showMagnifier && magnifier_configure && window_context) { SclPoint pos = {0, 0}; /* calculates x position to be set */ - pos.x = (coordinate->x + (coordinate->width / 2)) - + pos.x = window_context->geometry.x; + pos.x += (coordinate->x + (coordinate->width / 2)) - (magnifier_configure->width * utils->get_custom_scale_rate_x() / 2); /* calculates y position to be set */ - sclint scnWidth, scnHeight; - utils->get_screen_resolution(&scnWidth, &scnHeight); - - pos.y = (scnHeight - layout->height) + coordinate->y - - magnifier_configure->height * utils->get_custom_scale_rate_y(); + pos.y = window_context->geometry.y; + pos.y += coordinate->y - magnifier_configure->height * utils->get_custom_scale_rate_y(); - if (pos.x < 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x()) { - pos.x = 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x(); + if (pos.x < window_context->geometry.x - magnifier_configure->padding_x * utils->get_custom_scale_rate_x()) { + pos.x = window_context->geometry.x - magnifier_configure->padding_x * utils->get_custom_scale_rate_x(); } - if (pos.x > scnWidth + + if (pos.x > window_context->geometry.x + window_context->geometry.width + magnifier_configure->padding_x * utils->get_custom_scale_rate_x() - magnifier_configure->width * utils->get_custom_scale_rate_x()) { - pos.x = scnWidth + + pos.x = window_context->geometry.x + window_context->geometry.width + magnifier_configure->padding_x * utils->get_custom_scale_rate_x() - magnifier_configure->width * utils->get_custom_scale_rate_x(); } + pos.x += coordinate->magnifier_offset_x; pos.y += magnifier_configure->padding_y * utils->get_custom_scale_rate_y(); + pos.y += coordinate->magnifier_offset_y; if (windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP) == windows->get_base_window()) { windows->move_window(windows->get_magnifier_window(), pos.x, pos.y); windows->update_window(windows->get_magnifier_window()); -- 2.7.4