Set shape from command
This commit is contained in:
@ -35,6 +35,9 @@ class Painter(Widget):
|
||||
# list of particles
|
||||
self.particles=[]
|
||||
|
||||
# shape of particle to add next
|
||||
self.shape=Cross
|
||||
|
||||
# underlying lattice
|
||||
self.lattice=None
|
||||
|
||||
@ -229,8 +232,7 @@ class Painter(Widget):
|
||||
|
||||
# create new particle
|
||||
if touch.button=="right":
|
||||
new=Cross(touchx,touchy)
|
||||
#new=Disk(touchx,touchy)
|
||||
new=self.shape(touchx,touchy)
|
||||
# snap to lattice
|
||||
if self.lattice!=None:
|
||||
new.move(self.lattice.nearest_delta(new.elements[0].pos))
|
||||
|
Reference in New Issue
Block a user