fix: circular texture was slightly off-center (#1012)

This commit is contained in:
Aikhjarto 2019-09-14 07:12:23 +02:00 committed by Ogi Moore
parent c94b1cb99e
commit 8c137a1caf

View File

@ -61,7 +61,7 @@ class GLScatterPlotItem(GLGraphicsItem):
## Generate texture for rendering points
w = 64
def fn(x,y):
r = ((x-w/2.)**2 + (y-w/2.)**2) ** 0.5
r = ((x-(w-1)/2.)**2 + (y-(w-1)/2.)**2) ** 0.5
return 255 * (w/2. - np.clip(r, w/2.-1.0, w/2.))
pData = np.empty((w, w, 4))
pData[:] = 255