Allow square element to be a rectangle

This commit is contained in:
2022-09-28 18:42:06 -04:00
parent dd5917cd45
commit e5b6019606
4 changed files with 58 additions and 39 deletions

View File

@ -215,8 +215,8 @@ class Painter(Widget):
# create new particle
if touch.button=="right":
#new=Cross(touchx,touchy)
new=Disk(touchx,touchy)
new=Cross(touchx,touchy)
#new=Disk(touchx,touchy)
# snap to lattice
if self.lattice!=None:
new.move(self.lattice.nearest_delta(new.elements[0].pos))
@ -529,7 +529,7 @@ class Painter(Widget):
continue
if particle_type==CROSS_INDEX:
candidate=Cross(pos.x,pos.y,color=color)
elif particle_type==DISK_INDEX
elif particle_type==DISK_INDEX:
candidate=Disk(pos.x,pos.y,color=color)
else:
print("warning: ignoring line "+str(i)+" in file '"+file+"': unrecognized particle type: '"+entries[0]+"'",file=sys.stderr)