Commit 76fe92b
Fix SpriteList.insert() not rendering inserted sprite until next list sync (#2864)
* Fix SpriteList.insert() not marking index buffer as changed
SpriteList.insert() updated the CPU-side index data but never set
self._sprite_index_changed = True, unlike append() and every other
mutating method. As a result, a sprite added via insert() was present
in the list but never uploaded to the GPU index buffer, so it was not
rendered until an unrelated flag-setting operation forced a sync.
Set the flag at the end of insert() to mirror append().
Fixes #2863
* Validate texture in SpriteList.insert() to match append()
append() raises ValueError when a textureless sprite is added to an
initialized SpriteList. insert() silently accepted it. Mirror the same
guard in insert() for consistency between the two entry points.
Note: this is a validation-only change; the atlas registration itself
is already handled by _update_all() for both append() and insert().
---------
Co-authored-by: Paul Craven <paul.craven@optimizely.com>1 parent 6936399 commit 76fe92b
2 files changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
| 754 | + | |
754 | 755 | | |
755 | 756 | | |
756 | 757 | | |
757 | 758 | | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
758 | 763 | | |
759 | 764 | | |
760 | 765 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
119 | 136 | | |
120 | 137 | | |
121 | 138 | | |
| |||
0 commit comments