Commit 3a62d261 authored by Cory Quammen's avatar Cory Quammen
Browse files

Add guards for null XAxis and YAxis.

Commit 617ec438 introduced a regression caused by the assumption that
the XAxis and YAxis member variables are never null. This patch
handles the case where one or both of them are null.
parent 7cc94dec
......@@ -365,8 +365,8 @@ void vtkControlPointsItem::TransformScreenToData(const vtkVector2f& in, vtkVecto
out.SetX(static_cast<float>((out.GetX() / ss[2]) - ss[0]));
out.SetY(static_cast<float>((out.GetY() / ss[3]) - ss[1]));
const bool logX = this->GetXAxis()->GetLogScaleActive();
const bool logY = this->GetYAxis()->GetLogScaleActive();
const bool logX = this->GetXAxis() && this->GetXAxis()->GetLogScaleActive();
const bool logY = this->GetYAxis() && this->GetYAxis()->GetLogScaleActive();
if (logX)
{
......@@ -383,8 +383,8 @@ void vtkControlPointsItem::TransformDataToScreen(const vtkVector2f& in, vtkVecto
{
out = in;
const bool logX = this->GetXAxis()->GetLogScaleActive();
const bool logY = this->GetYAxis()->GetLogScaleActive();
const bool logX = this->GetXAxis() && this->GetXAxis()->GetLogScaleActive();
const bool logY = this->GetYAxis() && this->GetYAxis()->GetLogScaleActive();
if (logX)
{
......
Supports Markdown
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