Set undermouse even when selecting
This commit is contained in:
parent
98dcaacfb5
commit
a702a4a991
17
cross.py
17
cross.py
@ -294,11 +294,11 @@ class Cross_painter(Widget):
|
|||||||
|
|
||||||
# select cross
|
# select cross
|
||||||
if touch.button=="left":
|
if touch.button=="left":
|
||||||
# no modifiers
|
|
||||||
if self.modifiers==[]:
|
|
||||||
# find cross under touch
|
# find cross under touch
|
||||||
self.undermouse=self.find_cross(Point(touch.x/Cross.size,touch.y/Cross.size))
|
self.undermouse=self.find_cross(Point(touch.x/Cross.size,touch.y/Cross.size))
|
||||||
|
|
||||||
|
# no modifiers
|
||||||
|
if self.modifiers==[]:
|
||||||
if self.undermouse==None or not self.undermouse in self.selected:
|
if self.undermouse==None or not self.undermouse in self.selected:
|
||||||
# unselect all crosses
|
# unselect all crosses
|
||||||
for sel in self.selected:
|
for sel in self.selected:
|
||||||
@ -308,16 +308,15 @@ class Cross_painter(Widget):
|
|||||||
|
|
||||||
# shift-click
|
# shift-click
|
||||||
elif self.modifiers==['s']:
|
elif self.modifiers==['s']:
|
||||||
clicked=self.find_cross(Point(touch.x/Cross.size,touch.y/Cross.size))
|
if self.undermouse!=None:
|
||||||
if clicked!=None:
|
if self.undermouse not in self.selected:
|
||||||
if clicked not in self.selected:
|
self.selected.append(self.undermouse)
|
||||||
self.selected.append(clicked)
|
self.undermouse.selected=True
|
||||||
clicked.selected=True
|
|
||||||
else:
|
else:
|
||||||
# remove
|
# remove
|
||||||
self.selected[self.selected.index(clicked)]=self.selected[len(self.selected)-1]
|
self.selected[self.selected.index(self.undermouse)]=self.selected[len(self.selected)-1]
|
||||||
self.selected=self.selected[:len(self.selected)-1]
|
self.selected=self.selected[:len(self.selected)-1]
|
||||||
clicked.selected=False
|
self.undermouse.selected=False
|
||||||
|
|
||||||
self.draw()
|
self.draw()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user