Skip to content

Commit

Permalink
Fix #2790
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodmer committed Aug 16, 2023
1 parent 3fcadd2 commit 5c1f163
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Extensions/Sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ void* TFT_eSprite::createSprite(int16_t w, int16_t h, uint8_t frames)
_img8_2 = _img8 + (w * h + 1);
}

if ( (_bpp == 4) && (_colorMap == nullptr)) createPalette(default_4bit_palette);

// This is to make it clear what pointer size is expected to be used
// but casting in the user sketch is needed due to the use of void*
if ( (_bpp == 1) && (frames > 1) )
Expand All @@ -101,6 +99,8 @@ void* TFT_eSprite::createSprite(int16_t w, int16_t h, uint8_t frames)
if (_img8)
{
_created = true;
if ( (_bpp == 4) && (_colorMap == nullptr)) createPalette(default_4bit_palette);

rotation = 0;
setViewport(0, 0, _dwidth, _dheight);
setPivot(_iwidth/2, _iheight/2);
Expand Down

0 comments on commit 5c1f163

Please sign in to comment.