From 8a95a7b1b46e5f6809d58c6d460aca11890ca2cb Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 7 Jul 2017 14:13:05 +0900 Subject: [PATCH] Apply custom scale rate when showing magnifier window Change-Id: I12117980227aea4a8a8b740f8154d078c65b37ae --- scl/sclresourcecache.cpp | 20 ++++++++++---------- scl/scluibuilder.cpp | 31 +++++++++++++++---------------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/scl/sclresourcecache.cpp b/scl/sclresourcecache.cpp index 143c311..fbc3a8e 100644 --- a/scl/sclresourcecache.cpp +++ b/scl/sclresourcecache.cpp @@ -1057,19 +1057,19 @@ CSCLResourceCache::recompute_layout(sclwindow window) focus_handler->finalize_key_navigation_info(window); } } - } - /* Apply the custom scale rate value */ - (*pCurLayout).width *= utils->get_custom_scale_rate_x(); - (*pCurLayout).height *= utils->get_custom_scale_rate_y(); + /* Apply the custom scale rate value */ + (*pCurLayout).width *= utils->get_custom_scale_rate_x(); + (*pCurLayout).height *= utils->get_custom_scale_rate_y(); - (*pCurLayout).add_grab_left *= utils->get_custom_scale_rate_x(); - (*pCurLayout).add_grab_right *= utils->get_custom_scale_rate_x(); - (*pCurLayout).add_grab_top *= utils->get_custom_scale_rate_y(); - (*pCurLayout).add_grab_bottom *= utils->get_custom_scale_rate_y(); + (*pCurLayout).add_grab_left *= utils->get_custom_scale_rate_x(); + (*pCurLayout).add_grab_right *= utils->get_custom_scale_rate_x(); + (*pCurLayout).add_grab_top *= utils->get_custom_scale_rate_y(); + (*pCurLayout).add_grab_bottom *= utils->get_custom_scale_rate_y(); - (*pCurLayout).mouse_manipulate_x *= utils->get_custom_scale_rate_x(); - (*pCurLayout).mouse_manipulate_y *= utils->get_custom_scale_rate_y(); + (*pCurLayout).mouse_manipulate_x *= utils->get_custom_scale_rate_x(); + (*pCurLayout).mouse_manipulate_y *= utils->get_custom_scale_rate_y(); + } /* Resize window */ if (windows->is_base_window(window)) { diff --git a/scl/scluibuilder.cpp b/scl/scluibuilder.cpp index 014f3d6..e859241 100644 --- a/scl/scluibuilder.cpp +++ b/scl/scluibuilder.cpp @@ -1119,39 +1119,38 @@ CSCLUIBuilder::show_magnifier(const sclwindow window, scldrawctx draw_ctx) 0, 0, decoration_size, decoration_size); break; case WND_DECORATOR_TOP_CENTER: - m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, - decoration_size, 0, magnifier_configure->width - (2 * decoration_size), decoration_size); + m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, decoration_size, 0, + magnifier_configure->width * utils->get_custom_scale_rate_x()- (2 * decoration_size), decoration_size); break; case WND_DECORATOR_TOP_RIGHT: m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, - magnifier_configure->width - decoration_size, 0, decoration_size, decoration_size); + magnifier_configure->width * utils->get_custom_scale_rate_x() - decoration_size, 0, decoration_size, decoration_size); break; case WND_DECORATOR_MIDDLE_LEFT: - m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, - 0, decoration_size, decoration_size, magnifier_configure->height - (2 * decoration_size)); + m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, + decoration_size, decoration_size, magnifier_configure->height * utils->get_custom_scale_rate_y() - (2 * decoration_size)); break; case WND_DECORATOR_MIDDLE_CENTER: - m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, - 0, 0, magnifier_configure->width, magnifier_configure->height); + m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0, + magnifier_configure->width * utils->get_custom_scale_rate_x(), magnifier_configure->height * utils->get_custom_scale_rate_y()); break; case WND_DECORATOR_MIDDLE_RIGHT: m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, - magnifier_configure->width - decoration_size, decoration_size, - decoration_size, magnifier_configure->height - (2 * decoration_size)); + magnifier_configure->width * utils->get_custom_scale_rate_x() - decoration_size, decoration_size, + decoration_size, magnifier_configure->height * utils->get_custom_scale_rate_y() - (2 * decoration_size)); break; case WND_DECORATOR_BOTTOM_LEFT: - m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, - 0, magnifier_configure->height - decoration_size, decoration_size, decoration_size); + m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, + magnifier_configure->height * utils->get_custom_scale_rate_y() - decoration_size, decoration_size, decoration_size); break; case WND_DECORATOR_BOTTOM_CENTER: m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, - decoration_size, magnifier_configure->height - decoration_size, - magnifier_configure->width - (2 * decoration_size), decoration_size); + decoration_size, magnifier_configure->height * utils->get_custom_scale_rate_y() - decoration_size, + magnifier_configure->width * utils->get_custom_scale_rate_x() - (2 * decoration_size), decoration_size); break; case WND_DECORATOR_BOTTOM_RIGHT: - m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, - magnifier_configure->width - decoration_size, magnifier_configure->height - decoration_size, - decoration_size, decoration_size); + m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, magnifier_configure->width * utils->get_custom_scale_rate_x() + - decoration_size, magnifier_configure->height * utils->get_custom_scale_rate_y() - decoration_size, decoration_size, decoration_size); break; } } -- 2.7.4