@@ -1543,8 +1543,8 @@ def to_normalized_pos(self, x, y):
1543
1543
)
1544
1544
1545
1545
def transform_motion_event_2d (self , me , widget = None ):
1546
- '''Returns transformed motion event `me` to this window size and then
1547
- if `widget` is passed transforms `me` to `widget`'s local coordinates.
1546
+ '''Transforms the motion event `me` to this window size and then if
1547
+ `widget` is passed transforms `me` to `widget`'s local coordinates.
1548
1548
1549
1549
:raises:
1550
1550
`AttributeError`: If widget's ancestor is ``None``.
@@ -1564,22 +1564,20 @@ def transform_motion_event_2d(self, me, widget=None):
1564
1564
smode = self .softinput_mode ,
1565
1565
kheight = self .keyboard_height
1566
1566
)
1567
- if widget is None :
1568
- return me
1569
- parent = widget .parent
1570
- try :
1571
- if parent :
1572
- me .apply_transform_2d (parent .to_widget )
1573
- else :
1574
- me .apply_transform_2d (widget .to_widget )
1575
- me .apply_transform_2d (widget .to_parent )
1576
- except AttributeError :
1577
- # when using inner window, an app have grab the touch
1578
- # but app is removed. The touch can't access
1579
- # to one of the parent. (i.e, self.parent will be None)
1580
- # and BAM the bug happen.
1581
- raise
1582
- return me
1567
+ if widget is not None :
1568
+ parent = widget .parent
1569
+ try :
1570
+ if parent :
1571
+ me .apply_transform_2d (parent .to_widget )
1572
+ else :
1573
+ me .apply_transform_2d (widget .to_widget )
1574
+ me .apply_transform_2d (widget .to_parent )
1575
+ except AttributeError :
1576
+ # when using inner window, an app have grab the touch
1577
+ # but app is removed. The touch can't access
1578
+ # to one of the parent. (i.e, self.parent will be None)
1579
+ # and BAM the bug happen.
1580
+ raise
1583
1581
1584
1582
def _apply_transform (self , m ):
1585
1583
return m
0 commit comments