diff --git a/src/lib/sw_engine/tvgSwShape.cpp b/src/lib/sw_engine/tvgSwShape.cpp index 4dcb91c3..7756e7d4 100644 --- a/src/lib/sw_engine/tvgSwShape.cpp +++ b/src/lib/sw_engine/tvgSwShape.cpp @@ -401,7 +401,7 @@ bool shapeGenRle(SwShape* shape, TVG_UNUSED const Shape* sdata, bool antiAlias, //Case A: Fast Track Rectangle Drawing if (!hasComposite && (shape->rect = _fastTrack(shape->outline))) return true; //Case B: Normale Shape RLE Drawing - if ((shape->rle = rleRender(shape->rle, shape->outline, shape->bbox,antiAlias))) return true; + if ((shape->rle = rleRender(shape->rle, shape->outline, shape->bbox, antiAlias))) return true; return false; } diff --git a/src/lib/tvgPaint.h b/src/lib/tvgPaint.h index 7ba2d16b..adb7cfef 100644 --- a/src/lib/tvgPaint.h +++ b/src/lib/tvgPaint.h @@ -214,6 +214,7 @@ namespace tvg RenderRegion viewport2; if ((cmpFastTrack = _clipPathFastTrack(cmpTarget, pTransform, viewport2))) { viewport = renderer.viewport(); + viewport2.merge(viewport); renderer.viewport(viewport2); } } diff --git a/src/lib/tvgRender.h b/src/lib/tvgRender.h index 7b06fb7d..510420e5 100644 --- a/src/lib/tvgRender.h +++ b/src/lib/tvgRender.h @@ -48,6 +48,19 @@ struct Compositor { struct RenderRegion { uint32_t x, y, w, h; + + void merge(const RenderRegion& rhs) + { + auto x1 = x + w; + auto y1 = y + h; + auto x2 = rhs.x + rhs.w; + auto y2 = rhs.y + rhs.h; + + x = max(x, rhs.x); + y = max(y, rhs.y); + w = min(x1, x2) - x; + h = min(y1, y2) - y; + } }; struct RenderTransform