};
static void
-_e_pointer_configured_output_resolution_ratio_get(E_Client *ec, double *ratio_w, double *ratio_h)
+_e_pointer_configured_output_resolution_ratio_get(E_Client *ec, double *ratio)
{
E_Output *output;
E_Zone *zone;
+ double cal_ratio_w, cal_ratio_h, cal_ratio;
- if (ratio_w) *ratio_w = 1.0;
- if (ratio_h) *ratio_h = 1.0;
+ if (!ratio) return;
+
+ *ratio = 1.0;
if (!e_config->cursor_configured_output_resolution.use) return;
if (e_config->cursor_configured_output_resolution.w == 0) return;
if (output->config.geom.w == 0) return;
if (output->config.geom.h == 0) return;
- if (ratio_w)
- *ratio_w = (double)output->config.geom.w /
+ cal_ratio_w = (double)output->config.geom.w /
(double)e_config->cursor_configured_output_resolution.w;
- if (ratio_h)
- *ratio_h = (double)output->config.geom.h /
+
+ cal_ratio_h = (double)output->config.geom.h /
(double)e_config->cursor_configured_output_resolution.h;
+
+ cal_ratio = MIN(cal_ratio_w, cal_ratio_h);
+
+ *ratio = cal_ratio;
}
/* move the cursor image with the calcaultion of the hot spot */
int rotation;
int cursor_w, cursor_h;
E_Client *ec;
- double ratio_w = 1.0, ratio_h = 1.0;
+ double ratio = 1.0;
int hot_x = 0, hot_y = 0;
if (!ptr->o_ptr) return;
rotation = ptr->rotation;
evas_object_geometry_get(ec->frame, NULL, NULL, &cursor_w, &cursor_h);
- _e_pointer_configured_output_resolution_ratio_get(ec, &ratio_w, &ratio_h);
+ _e_pointer_configured_output_resolution_ratio_get(ec, &ratio);
- if ((ratio_w != 1.0) || (ratio_h != 1.0))
+ if (ratio != 1.0)
{
- hot_x = (int)((double)ptr->hot.x * ratio_w);
- hot_y = (int)((double)ptr->hot.y * ratio_h);
+ hot_x = (int)((double)ptr->hot.x * ratio);
+ hot_y = (int)((double)ptr->hot.y * ratio);
}
else
{
int x, y, w, h;
E_Client *ec;
int rotation = 0;
- double ratio_w = 1.0, ratio_h = 1.0;
+ double ratio = 1.0;
EINA_SAFETY_ON_NULL_RETURN(ptr);
if (!ptr->o_ptr) return;
ec = e_comp_object_client_get(ptr->o_ptr);
EINA_SAFETY_ON_NULL_RETURN(ec);
- _e_pointer_configured_output_resolution_ratio_get(ec, &ratio_w, &ratio_h);
+ _e_pointer_configured_output_resolution_ratio_get(ec, &ratio);
rotation = ptr->rotation;
- if (((ratio_w == 1.0) && (ratio_h == 1.0)) &&
+ if ((ratio == 1.0) &&
((rotation == 0) || (rotation % 90 != 0) || (rotation / 90 > 3)))
{
e_client_map_enable_set(ec, EINA_FALSE);
e_map_util_points_populate_from_object_full(map, ec->frame, 0);
- if ((ratio_w != 1.0) || (ratio_h != 1.0))
+ if (ratio != 1.0)
{
- e_map_point_coord_set(map, 1, x + (int)((double)w * ratio_w), y, 0);
- e_map_point_coord_set(map, 2, x + (int)((double)w * ratio_w),
- y + (int)((double)h * ratio_h), 0);
- e_map_point_coord_set(map, 3, x, y + (int)((double)h * ratio_h), 0);
+ e_map_point_coord_set(map, 1, x + (int)((double)w * ratio), y, 0);
+ e_map_point_coord_set(map, 2, x + (int)((double)w * ratio),
+ y + (int)((double)h * ratio), 0);
+ e_map_point_coord_set(map, 3, x, y + (int)((double)h * ratio), 0);
}
if (rotation)