Avoid multiple values for `noadd` in `VertexInstruction` (#8374)

* 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>
This commit is contained in:
Dexer 2023-11-01 14:29:12 -03:00 committed by GitHub
parent 64d295c1a5
commit 276ff18fc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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)
@ -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()