Set color of next particle
This commit is contained in:
parent
0a8a0e3c53
commit
ff11c1ce84
@ -38,6 +38,9 @@ class Painter(Widget):
|
||||
# shape of particle to add next
|
||||
self.shape=Cross
|
||||
|
||||
# color of particle to add next
|
||||
self.color=(0,0,1)
|
||||
|
||||
# underlying lattice
|
||||
self.lattice=None
|
||||
|
||||
@ -232,7 +235,7 @@ class Painter(Widget):
|
||||
|
||||
# create new particle
|
||||
if touch.button=="right":
|
||||
new=self.shape(touchx,touchy)
|
||||
new=self.shape(touchx,touchy,color=self.color)
|
||||
# snap to lattice
|
||||
if self.lattice!=None:
|
||||
new.move(self.lattice.nearest_delta(new.elements[0].pos))
|
||||
@ -440,6 +443,9 @@ class Painter(Widget):
|
||||
|
||||
# set color of selected particles
|
||||
def set_color(self,color):
|
||||
# set color for next particles
|
||||
self.color=color
|
||||
# set color of selected particles
|
||||
for particle in self.selected:
|
||||
particle.color=color
|
||||
# redraw
|
||||
|
Loading…
Reference in New Issue
Block a user