Fix lattice_points for disk
This commit is contained in:
parent
a48457de29
commit
1cd4e0fdc6
@ -290,7 +290,7 @@ class Element_circle(Element):
|
|||||||
dx=math.floor(0.5*self.size/lattice.spacing)
|
dx=math.floor(0.5*self.size/lattice.spacing)
|
||||||
for i in range(-dx,dx+1):
|
for i in range(-dx,dx+1):
|
||||||
for j in range(-dx,dx+1):
|
for j in range(-dx,dx+1):
|
||||||
if i*i+j*j<=2*dx*dx:
|
if lattice.spacing*lattice.spacing*(i*i+j*j)<=self.size*self.size/4:
|
||||||
out.append(Point(self.pos.x+i*lattice.spacing,self.pos.y+j*lattice.spacing))
|
out.append(Point(self.pos.x+i*lattice.spacing,self.pos.y+j*lattice.spacing))
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ class Painter(Widget):
|
|||||||
if count==0:
|
if count==0:
|
||||||
return
|
return
|
||||||
Color(color[0],color[1],color[2],1-count*0.1)
|
Color(color[0],color[1],color[2],1-count*0.1)
|
||||||
Rectangle(pos=(self.pos_tocoord_x(x-0.5),self.pos_tocoord_y(y-0.5)),size=(self.base_size,self.base_size))
|
Rectangle(pos=(self.pos_tocoord_x(x-0.5*self.lattice.spacing),self.pos_tocoord_y(y-0.5*self.lattice.spacing)),size=(self.base_size*self.lattice.spacing,self.base_size*self.lattice.spacing))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user