You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When uninstalling a bitmap font with characters containing a space it throws an error:
BitmapFontManager › should uninstall and remove from Cache
TypeError: Cannot read properties of undefined (reading 'destroy')
192 | for (const i in this.chars)
193 | {
> 194 | this.chars[i].texture.destroy();
| ^
195 | }
196 |
197 | (this.chars as null) = null;
at DynamicBitmapFont.destroy (src/scene/text-bitmap/AbstractBitmapFont.ts:194:35)
at DynamicBitmapFont.destroy (src/scene/text-bitmap/DynamicBitmapFont.ts:406:15)
at BitmapFontManagerClass.uninstall (src/scene/text-bitmap/BitmapFontManager.ts:257:18)
Install a font with chars containing a space.
Uninstall it
import{Cache}from'../../../src/assets/cache/Cache';import{BitmapFontManager}from'../../../src/scene/text-bitmap/BitmapFontManager';importtype{BitmapFont}from'../../../src/scene/text-bitmap/BitmapFont';describe('BitmapFontManager',()=>{it('should uninstall and remove from Cache',()=>{BitmapFontManager.install('foo',{},{chars: ' '});expect(Cache.get<BitmapFont>('foo-bitmap')).toBeDefined();BitmapFontManager.uninstall('foo');expect(Cache.get<BitmapFont>('foo-bitmap')).toBeUndefined();});});
Current Behavior
When uninstalling a bitmap font with characters containing a space it throws an error:
this.chars[i]
doesn't havetexture
field:Expected Behavior
It uninstalls the font successfully
Steps to Reproduce
Install a font with
chars
containing a space.Uninstall it
Environment
pixi.js
version: 8.1.0Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: