Skip to content

Commit

Permalink
Avoid multiple values for noadd in VertexInstruction (#8374)
Browse files Browse the repository at this point in the history
* avoid multiple values for 'noadd'

* Update kivy/graphics/instructions.pyx

Co-authored-by: Mirko Galimberti <me@mirkogalimberti.com>

---------

Co-authored-by: Mirko Galimberti <me@mirkogalimberti.com>
  • Loading branch information
DexerBR and misl6 committed Nov 1, 2023
1 parent 64d295c commit 276ff18
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kivy/graphics/instructions.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ cdef class VertexInstruction(Instruction):
Triangles, Lines, Ellipse and so on.
'''
def __init__(self, **kwargs):
# avoid multiple values for 'noadd' in BindTexture below
noadd_value = kwargs.pop('noadd', False)

# Set a BindTexture instruction to bind the texture used for
# this instruction before the actual vertex instruction
self.texture_binding = BindTexture(noadd=True, **kwargs)
Expand All @@ -297,7 +300,7 @@ cdef class VertexInstruction(Instruction):
if tex_coords:
self.tex_coords = tex_coords

Instruction.__init__(self, **kwargs)
Instruction.__init__(self, noadd=noadd_value, **kwargs)
self.flags = GI_VERTEX_DATA & GI_NEEDS_UPDATE
self.batch = VertexBatch()

Expand Down

0 comments on commit 276ff18

Please sign in to comment.