From 5cf27f9b8d0078c7a9662b555785f742d5214002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 15 Apr 2005 15:22:20 +0000 Subject: [PATCH] fix bug with internal AGG renderer color not being updated when a special solid drawing mode is used git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12417 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/drawing/Painter/Painter.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index 6a3119e458..7a46d354ad 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -152,8 +152,6 @@ void Painter::SetDrawData(const DrawData* data) { // for now... - SetHighColor(data->highcolor.GetColor32()); - SetLowColor(data->lowcolor.GetColor32()); SetPenSize(data->pensize); SetPenLocation(data->penlocation); SetFont(data->font); @@ -174,6 +172,9 @@ Painter::SetDrawData(const DrawData* data) if (updateDrawingMode) _UpdateDrawingMode(); + + SetHighColor(data->highcolor.GetColor32()); + SetLowColor(data->lowcolor.GetColor32()); } // #pragma mark - @@ -201,6 +202,8 @@ void Painter::SetHighColor(const rgb_color& color) { fPatternHandler->SetHighColor(color); + if (*(fPatternHandler->GetR5Pattern()) == B_SOLID_HIGH) + _SetRendererColor(color); } // SetLowColor @@ -208,6 +211,8 @@ void Painter::SetLowColor(const rgb_color& color) { fPatternHandler->SetLowColor(color);; + if (*(fPatternHandler->GetR5Pattern()) == B_SOLID_LOW) + _SetRendererColor(color); } // SetPenSize @@ -335,7 +340,7 @@ Painter::StrokeLine(BPoint a, BPoint b, DrawData* context) return _Clipped(touched); } } - +//printf("StrokeLine((%.2f, %.2f)->(%.2f, %.2f)) -> AGG version\n", a.x, a.y, b.x, b.y); // do the pixel center offset here a.x += 0.5; a.y += 0.5; @@ -1036,12 +1041,14 @@ Painter::_UpdateDrawingMode() DrawingMode* mode = NULL; pattern p = *fPatternHandler->GetR5Pattern(); if (p == B_SOLID_HIGH) { +// TODO: fix me! is already set in SetHighColor() _SetRendererColor(fPatternHandler->HighColor().GetColor32()); mode = fDrawingModeFactory->DrawingModeFor(fDrawingMode, fAlphaSrcMode, fAlphaFncMode, true); } else if (p == B_SOLID_LOW) { +// TODO: fix me! is already set in SetLowColor() _SetRendererColor(fPatternHandler->LowColor().GetColor32()); mode = fDrawingModeFactory->DrawingModeFor(fDrawingMode, fAlphaSrcMode,