From 216469fab085e507bccab6c66bd9fb39cb48dc79 Mon Sep 17 00:00:00 2001 From: Yousef Khadadeh Date: Thu, 5 Feb 2026 16:42:57 +0300 Subject: [PATCH] Change cliprect calculation --- src/DrawingProgram/DrawingProgramCache.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/DrawingProgram/DrawingProgramCache.cpp b/src/DrawingProgram/DrawingProgramCache.cpp index e58c036..cdc1b4c 100644 --- a/src/DrawingProgram/DrawingProgramCache.cpp +++ b/src/DrawingProgram/DrawingProgramCache.cpp @@ -300,12 +300,11 @@ void DrawingProgramCache::refresh_draw_cache(const std::shared_ptr((iBounds.max.x() - bvhNode->bounds.min.x()) / bDim.x()) * bvhNode->resolution.x(), static_cast((iBounds.max.y() - bvhNode->bounds.min.y()) / bDim.y()) * bvhNode->resolution.y()}; - SkIRect clipRect = SkIRect::MakeLTRB(clipBoundMin.x() - 2, - clipBoundMin.y() - 2, - clipBoundMax.x() + 2, - clipBoundMax.y() + 2); - SCollision::AABB clipRectBoundAABB{clipBoundMin - Vector2f{4, 4}, clipBoundMax + Vector2f{4, 4}}; + SkIRect clipRect = SkIRect::MakeLTRB(clipRectBoundAABB.min.x(), + clipRectBoundAABB.min.y(), + clipRectBoundAABB.max.x(), + clipRectBoundAABB.max.y()); SCollision::AABB clipRectBoundAABBWorld{ bvhNode->coords.from_space(clipRectBoundAABB.min), bvhNode->coords.from_space(clipRectBoundAABB.max)