{
int last_x = gi->event.x;
int last_y = gi->event.y;
+ int last_mx = gi->event.mx;
+ int last_my = gi->event.my;
- gi->event.x = mx - gi->x;
- gi->event.y = my - gi->y;
+ gi->event.x = gi->event.mx = mx - gi->x;
+ gi->event.y = gi->event.my = my - gi->y;
if (gi->type == GD_TYPE_DRAWING_AREA)
{
gi->event.x /= gi->drawing.item_xsize;
gi->event.y /= gi->drawing.item_ysize;
- if (last_x != gi->event.x || last_y != gi->event.y)
+ if (last_x != gi->event.x || last_y != gi->event.y ||
+ ((last_mx != gi->event.mx || last_my != gi->event.my) &&
+ gi->event_mask & GD_EVENT_PIXEL_PRECISE))
changed_position = TRUE;
}
else if (gi->type & GD_TYPE_TEXT_INPUT && button != 0 && !motion_status)
#define GD_EVENT_TEXT_LEAVING (1 << 6)
#define GD_EVENT_INFO_ENTERING (1 << 7)
#define GD_EVENT_INFO_LEAVING (1 << 8)
+#define GD_EVENT_PIXEL_PRECISE (1 << 9)
/* gadget button states */
#define GD_BUTTON_UNPRESSED 0
{
unsigned int type; /* event type */
int button; /* button number for button events */
+ int mx, my; /* raw gadget position at event time */
int x, y; /* gadget position at event time */
boolean off_borders; /* mouse pointer outside gadget? */
int item_x, item_y, item_position; /* new item position */