.pio/libdeps/m5stack-core2/M5Core2/src/utility/Sprite.cpp
void TFT_eSprite::setScrollRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t color)
{
  if ((x >= _iwidth) || (y >= _iheight) || !_created ) return;

  if (x < 0) { w += x; x = 0; }
  if (y < 0) { h += y; y = 0; }

  if ((x + w) > _iwidth ) w = _iwidth  - x;
  if ((y + h) > _iheight) h = _iheight - y;

  if ( w < 1 || h < 1) return;  

  _sx = x;
  _sy = y;
  _sw = w;
  _sh = h;

  _scolor = color;
}
/***************************************************************************************
** Function name:           setScrollRect
** Description:             Set scroll area within the sprite and the gap fill colour
*************************************************************************************x*/
Function name:           setScrollRect
Description:             Set scroll area within the sprite and the gap fill colour
x
Function name : setScrollRect Description : Set scroll area within the sprite and the gap fill colour x
void TFT_eSprite::setScrollRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t color)
{
  if ((x >= _iwidth) || (y >= _iheight) || !_created ) return;
  if (x < 0) { w += x; x = 0; }
  if (y < 0) { h += y; y = 0; }
  if ((x + w) > _iwidth ) w = _iwidth  - x;
  if ((y + h) > _iheight) h = _iheight - y;
  if ( w < 1 || h < 1) return;  
  _sx = x;
  _sy = y;
  _sw = w;
  _sh = h;
  _scolor = color;
}
void TFT_eSprite :: setScrollRect ( int32_t x , int32_t y , int32_t w , int32_t h , uint16_t color ) { if ( ( x >= _iwidth ) || ( y >= _iheight ) || ! _created ) return ; if ( x < 0 ) { w += x ; x = 0 ; } if ( y < 0 ) { h += y ; y = 0 ; } if ( ( x + w ) > _iwidth ) w = _iwidth - x ; if ( ( y + h ) > _iheight ) h = _iheight - y ; if ( w < 1 || h < 1 ) return ; _sx = x ; _sy = y ; _sw = w ; _sh = h ; _scolor = color ; }
Function name:           setScrollRect
Description:             Set scroll area within the sprite and the gap fill colour
x
Function name : setScrollRect Description : Set scroll area within the sprite and the gap fill colour x