Skip to content

Commit

Permalink
fix(widget-event): the touch point coordinate are not been converted
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-soft committed Mar 4, 2018
1 parent c77c1e3 commit a40eda2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gui/widget_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,17 +915,21 @@ static int DispatchTouchEvent( LinkedList *capturers,
LCUI_TouchPoint points, int n_points )
{
int i, count;
float scale;
LCUI_WidgetEventRec ev = { 0 };
LCUI_Widget target, root, w;
LinkedListNode *node, *ptnode;

root = LCUIWidget_GetRoot();
scale = LCUIMetrics_GetScale();
ev.type = LCUI_WEVENT_TOUCH;
ev.cancel_bubble = FALSE;
root = LCUIWidget_GetRoot();
ev.touch.points = NEW( LCUI_TouchPointRec, n_points );
/* 先将各个触点按命中的部件进行分组 */
for( i = 0; i < n_points; ++i ) {
target = Widget_At( root, points[i].x, points[i].y );
target = Widget_At( root,
iround( points[i].x / scale ),
iround( points[i].y / scale ) );
if( !target ) {
continue;
}
Expand Down

0 comments on commit a40eda2

Please sign in to comment.