PictureDataWriter: Fix invert rect.

Resetting the drawing mode to B_OP_COPY was not right, since the previous mode could be anything.
Use WritePush/PopState() instead.

Change-Id: If9cba2c46bf372fd0164d951fcc49696cf72d576
This commit is contained in:
JackBurton79
2018-09-10 16:14:49 +02:00
parent da51ebe0e5
commit 5706737797
+2 -1
View File
@@ -75,13 +75,14 @@ status_t
PictureDataWriter::WriteInvertRect(const BRect& rect)
{
try {
WritePushState();
WriteSetDrawingMode(B_OP_INVERT);
BeginOp(B_PIC_FILL_RECT);
Write<BRect>(rect);
EndOp();
WriteSetDrawingMode(B_OP_COPY);
WritePopState();
} catch (status_t& status) {
return status;
}