Make projection shaders compatible with streamlines (#2160)

Co-authored-by: Laith Bahodi <70682032+hydrobeam@users.noreply.github.com>
This commit is contained in:
Ryan McCauley 2021-10-27 00:58:31 +01:00 committed by GitHub
commit a2fac4b9f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -210,11 +210,14 @@ def render_mobject_strokes_with_matrix(renderer, model_matrix, mobjects):
end_offset = write_offset + submob.points.shape[0]
points[write_offset:end_offset] = submob.points
colors[write_offset:end_offset] = np.repeat(
submob.stroke_rgba,
submob.points.shape[0],
axis=0,
)
if submob.stroke_rgba.shape[0] == points[write_offset:end_offset].shape[0]:
colors[write_offset:end_offset] = submob.stroke_rgba
else:
colors[write_offset:end_offset] = np.repeat(
submob.stroke_rgba,
submob.points.shape[0],
axis=0,
)
widths[write_offset:end_offset] = np.repeat(
submob.stroke_width,
submob.points.shape[0],