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());