Skip to content
Snippets Groups Projects
Commit 23d97ae3 authored by Joachim Pouderoux's avatar Joachim Pouderoux
Browse files

Fix black box plots issue.

For black box plots a grey pen is used to let see the median correctly
but the default pen was not reset after.

Change-Id: I904040f8f8f54da4a50a054f8023a5d527ed1b86
parent dd6ee504
No related branches found
No related tags found
No related merge requests found
...@@ -114,8 +114,6 @@ bool vtkPlotBox::Paint(vtkContext2D *painter) ...@@ -114,8 +114,6 @@ bool vtkPlotBox::Paint(vtkContext2D *painter)
return false; return false;
} }
painter->ApplyPen(this->Pen);
if (this->Storage->size() == 0 || this->Storage->at(0).size() < 5) if (this->Storage->size() == 0 || this->Storage->at(0).size() < 5)
{ {
return false; return false;
...@@ -156,6 +154,8 @@ void vtkPlotBox::DrawBoxPlot(int i, unsigned char *rgba, double x, ...@@ -156,6 +154,8 @@ void vtkPlotBox::DrawBoxPlot(int i, unsigned char *rgba, double x,
return; return;
} }
painter->ApplyPen(this->Pen);
vtkNew<vtkBrush> brush; vtkNew<vtkBrush> brush;
brush->SetColor(rgba); brush->SetColor(rgba);
painter->ApplyBrush(brush.GetPointer()); painter->ApplyBrush(brush.GetPointer());
...@@ -185,11 +185,12 @@ void vtkPlotBox::DrawBoxPlot(int i, unsigned char *rgba, double x, ...@@ -185,11 +185,12 @@ void vtkPlotBox::DrawBoxPlot(int i, unsigned char *rgba, double x,
// Use a gray pen if the brush is black so the median is always visible // Use a gray pen if the brush is black so the median is always visible
if (brushColor[0] == 0 && brushColor[1] == 0 && brushColor[2] == 0) if (brushColor[0] == 0 && brushColor[1] == 0 && brushColor[2] == 0)
{ {
whitePen->SetWidth(std::max(1.0, this->Pen->GetWidth() - 1.0)); whitePen->SetWidth(this->Pen->GetWidth());
whitePen->SetColor(128, 128, 128, 128); whitePen->SetColor(128, 128, 128, 128);
whitePen->SetOpacity(this->Pen->GetOpacity()); whitePen->SetOpacity(this->Pen->GetOpacity());
painter->ApplyPen(whitePen.GetPointer()); painter->ApplyPen(whitePen.GetPointer());
} }
painter->DrawLine(xneg, q[2], xpos, q[2]); painter->DrawLine(xneg, q[2], xpos, q[2]);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment