From 66f19f72018fa92c62a41b2535f3567515fe8f20 Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Tue, 11 Sep 2018 14:29:23 +0200 Subject: [PATCH] Fix ClipToPicture() inside a BPicture Mimic what is't done in clip_to_shape: call SetCanvasGeometry() and ResyncDrawState(). Change-Id: Ibbd77ec8cf90952d94ee35871736e145102a763e --- src/servers/app/ServerPicture.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/servers/app/ServerPicture.cpp b/src/servers/app/ServerPicture.cpp index 67918bdba2..316340afbd 100644 --- a/src/servers/app/ServerPicture.cpp +++ b/src/servers/app/ServerPicture.cpp @@ -475,7 +475,6 @@ static void clip_to_picture(void* _canvas, int32 pictureToken, const BPoint& where, bool clipToInverse) { - // TODO: Doesn't seem to work Canvas* const canvas = reinterpret_cast(_canvas); ServerPicture* picture = canvas->GetPicture(pictureToken); @@ -484,7 +483,9 @@ clip_to_picture(void* _canvas, int32 pictureToken, const BPoint& where, AlphaMask* mask = new(std::nothrow) PictureAlphaMask(canvas->GetAlphaMask(), picture, *canvas->CurrentState(), where, clipToInverse); canvas->SetAlphaMask(mask); - canvas->UpdateCurrentDrawingRegion(); + canvas->CurrentState()->GetAlphaMask()->SetCanvasGeometry(BPoint(0, 0), + canvas->Bounds()); + canvas->ResyncDrawState(); if (mask != NULL) mask->ReleaseReference();