return ho;
}
-static inline void apply_orientation(int degree, int *x, int *y, input_event_source_e source)
+static inline void apply_orientation(int degree, int *x, int *y, int width, int height, input_event_source_e source)
{
int _x;
int _y;
return;
}
+ _x = *x;
+ _y = *y;
+
switch (degree) {
case 0:
return;
case 90:
- _x = *x;
- _y = *y;
-
- *x = -_y;
- *y = _x;
+ *x = _y;
+ *y = width - _x;
return;
case 180:
- _x = *x;
- _y = *y;
- _angle = degree;
-
- *x = -_x;
- *y = -_y;
+ *x = width - _x;
+ *y = height - _y;
return;
case 270:
- _x = *x;
- _y = *y;
- _angle = degree;
-
- *x = _y;
- *y = -_x;
+ *x = height - _y;
+ *y = _x;
return;
default:
- _x = *x;
- _y = *y;
+ /**
+ * @FIXME
+ * This rotation formular is not work correctly.
+ * The pointer should be rotated by other way.
+ * This is not what we want.
+ */
_angle = degree;
*x = (double)_x * cos((double)_angle) - (double)_y * sin((double)_angle);
evas_event_feed_mouse_out(info->e, timestamp, NULL);
break;
case WIDGET_BUFFER_EVENT_DOWN:
- apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y, event_info->info.pointer.source);
+ apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y, info->w, info->h, event_info->info.pointer.source);
if (info->pressed) {
ErrPrint("MOUSE UP is not called\n");
ErrPrint("DOWN[%s] %dx%d - %lf\n", info->id, event_info->info.pointer.x, event_info->info.pointer.y, timestamp);
break;
case WIDGET_BUFFER_EVENT_MOVE:
- apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y, event_info->info.pointer.source);
+ apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y, info->w, info->h, event_info->info.pointer.source);
/**
* @note
* Calculate the event occurred X & Y on the buffer
evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, timestamp, NULL);
break;
case WIDGET_BUFFER_EVENT_UP:
- apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y, event_info->info.pointer.source);
+ apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y, info->w, info->h, event_info->info.pointer.source);
evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, timestamp, NULL);
evas_event_feed_mouse_up(info->e, 1, EVAS_BUTTON_NONE, timestamp, NULL);
info->pressed = 0;