Commit 23d97ae3 authored by Joachim Pouderoux's avatar Joachim Pouderoux

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
......@@ -114,8 +114,6 @@ bool vtkPlotBox::Paint(vtkContext2D *painter)
return false;
}
painter->ApplyPen(this->Pen);
if (this->Storage->size() == 0 || this->Storage->at(0).size() < 5)
{
return false;
......@@ -156,6 +154,8 @@ void vtkPlotBox::DrawBoxPlot(int i, unsigned char *rgba, double x,
return;
}
painter->ApplyPen(this->Pen);
vtkNew<vtkBrush> brush;
brush->SetColor(rgba);
painter->ApplyBrush(brush.GetPointer());
......@@ -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
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->SetOpacity(this->Pen->GetOpacity());
painter->ApplyPen(whitePen.GetPointer());
}
painter->DrawLine(xneg, q[2], xpos, q[2]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment