RGBA and Image textures could exceed their tarea if given an x or y offset
inside the area that is > 0.
{
RrRect narea = tarea;
RrTextureImage *img = &a->texture[i].data.image;
{
RrRect narea = tarea;
RrTextureImage *img = &a->texture[i].data.image;
- if (img->twidth)
- narea.width = MIN(tarea.width, img->twidth);
- if (img->theight)
- narea.height = MIN(tarea.height, img->theight);
+ narea.width -= img->tx;
+ narea.height -= img->ty;
+ if (img->twidth)
+ narea.width = MIN(narea.width, img->twidth);
+ if (img->theight)
+ narea.height = MIN(narea.height, img->theight);
RrImageDrawImage(a->surface.pixel_data,
&a->texture[i].data.image,
a->w, a->h,
RrImageDrawImage(a->surface.pixel_data,
&a->texture[i].data.image,
a->w, a->h,
{
RrRect narea = tarea;
RrTextureRGBA *rgb = &a->texture[i].data.rgba;
{
RrRect narea = tarea;
RrTextureRGBA *rgb = &a->texture[i].data.rgba;
- if (rgb->twidth)
- narea.width = MIN(tarea.width, rgb->twidth);
- if (rgb->theight)
- narea.height = MIN(tarea.height, rgb->theight);
+ narea.width -= rgb->tx;
+ narea.height -= rgb->ty;
+ if (rgb->twidth)
+ narea.width = MIN(narea.width, rgb->twidth);
+ if (rgb->theight)
+ narea.height = MIN(narea.height, rgb->theight);
RrImageDrawRGBA(a->surface.pixel_data,
&a->texture[i].data.rgba,
a->w, a->h,
RrImageDrawRGBA(a->surface.pixel_data,
&a->texture[i].data.rgba,
a->w, a->h,