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
This commit is contained in:
Stephan Aßmus 2005-04-15 15:22:20 +00:00
parent 99d36ad1d1
commit 5cf27f9b8d

View File

@ -152,8 +152,6 @@ void
Painter::SetDrawData(const DrawData* data) Painter::SetDrawData(const DrawData* data)
{ {
// for now... // for now...
SetHighColor(data->highcolor.GetColor32());
SetLowColor(data->lowcolor.GetColor32());
SetPenSize(data->pensize); SetPenSize(data->pensize);
SetPenLocation(data->penlocation); SetPenLocation(data->penlocation);
SetFont(data->font); SetFont(data->font);
@ -174,6 +172,9 @@ Painter::SetDrawData(const DrawData* data)
if (updateDrawingMode) if (updateDrawingMode)
_UpdateDrawingMode(); _UpdateDrawingMode();
SetHighColor(data->highcolor.GetColor32());
SetLowColor(data->lowcolor.GetColor32());
} }
// #pragma mark - // #pragma mark -
@ -201,6 +202,8 @@ void
Painter::SetHighColor(const rgb_color& color) Painter::SetHighColor(const rgb_color& color)
{ {
fPatternHandler->SetHighColor(color); fPatternHandler->SetHighColor(color);
if (*(fPatternHandler->GetR5Pattern()) == B_SOLID_HIGH)
_SetRendererColor(color);
} }
// SetLowColor // SetLowColor
@ -208,6 +211,8 @@ void
Painter::SetLowColor(const rgb_color& color) Painter::SetLowColor(const rgb_color& color)
{ {
fPatternHandler->SetLowColor(color);; fPatternHandler->SetLowColor(color);;
if (*(fPatternHandler->GetR5Pattern()) == B_SOLID_LOW)
_SetRendererColor(color);
} }
// SetPenSize // SetPenSize
@ -335,7 +340,7 @@ Painter::StrokeLine(BPoint a, BPoint b, DrawData* context)
return _Clipped(touched); 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 // do the pixel center offset here
a.x += 0.5; a.x += 0.5;
a.y += 0.5; a.y += 0.5;
@ -1036,12 +1041,14 @@ Painter::_UpdateDrawingMode()
DrawingMode* mode = NULL; DrawingMode* mode = NULL;
pattern p = *fPatternHandler->GetR5Pattern(); pattern p = *fPatternHandler->GetR5Pattern();
if (p == B_SOLID_HIGH) { if (p == B_SOLID_HIGH) {
// TODO: fix me! is already set in SetHighColor()
_SetRendererColor(fPatternHandler->HighColor().GetColor32()); _SetRendererColor(fPatternHandler->HighColor().GetColor32());
mode = fDrawingModeFactory->DrawingModeFor(fDrawingMode, mode = fDrawingModeFactory->DrawingModeFor(fDrawingMode,
fAlphaSrcMode, fAlphaSrcMode,
fAlphaFncMode, fAlphaFncMode,
true); true);
} else if (p == B_SOLID_LOW) { } else if (p == B_SOLID_LOW) {
// TODO: fix me! is already set in SetLowColor()
_SetRendererColor(fPatternHandler->LowColor().GetColor32()); _SetRendererColor(fPatternHandler->LowColor().GetColor32());
mode = fDrawingModeFactory->DrawingModeFor(fDrawingMode, mode = fDrawingModeFactory->DrawingModeFor(fDrawingMode,
fAlphaSrcMode, fAlphaSrcMode,