From 6a6060d8fe894ba35fb21c274a5c6570acdbb9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 1 Feb 2014 10:34:23 +0100 Subject: [PATCH] ServerWindow: Fix converting the clip picture origin The current view state is already used for the picture playback, the remaining conversion needs to take into account screen location and scrolling offset of the view. This may need further investigation: a) When is this updated? It needs to be whenever a View changes screen location, size or scroll offset, which may not be the times when this method is called. b) I am not sure if the scrolling offset is indeed part of this conversion... --- src/servers/app/ServerWindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 81f0ccaf4b..fd19504cc2 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -3626,9 +3626,12 @@ ServerWindow::_UpdateDrawState(View* view) DrawingEngine* drawingEngine = fWindow->GetDrawingEngine(); if (view != NULL && drawingEngine != NULL) { BPoint leftTop(0, 0); + if (view->GetAlphaMask() != NULL) { + view->ConvertToScreen(&leftTop); + view->GetAlphaMask()->Update(view->Bounds(), leftTop); + leftTop = BPoint(0, 0); + } view->ConvertToScreenForDrawing(&leftTop); - if (view->GetAlphaMask() != NULL) - view->GetAlphaMask()->Update(view->Bounds(), leftTop); drawingEngine->SetDrawState(view->CurrentState(), leftTop.x, leftTop.y); } }