sw_engine rle: fixing clipping with non overlaping figures

For clip that did not overlap with the plotted source, the whole
source was plotted - the size of the rle data was not updated.
This commit is contained in:
Mira Grudzinska 2021-02-07 00:01:49 +01:00 committed by Hermet Park
parent 2657acc1bc
commit 29ca149b4b

View file

@ -917,7 +917,12 @@ void rleFree(SwRleData* rle)
void updateRleSpans(SwRleData *rle, SwSpan* curSpans, uint32_t size)
{
if (!rle->spans || !curSpans || size == 0) return;
if (size == 0) {
rle->size = 0;
return;
}
if (!rle->spans || !curSpans) return;
rle->size = size;
rle->spans = static_cast<SwSpan*>(realloc(rle->spans, rle->size * sizeof(SwSpan)));