Commit 35c320e7 authored by Jan Kremer's avatar Jan Kremer

Fixed freeze in parallel coordinate plot, when difference between max and min is 0 for an axis.

parent 4f65c0ec
......@@ -271,12 +271,73 @@ void UPlotCanvas::DrawParallelCoordinatesPlot()
int32 x3 = canvasWidth * 3 / 5;
int32 x4 = canvasWidth * 4 / 5;
int32 x5 = canvasWidth;
int32 y0 = (PawnBase->Data->X[i] - PawnBase->Data->MinX) / (PawnBase->Data->MaxX - PawnBase->Data->MinX) * canvasHeight / 4;
int32 y1 = (PawnBase->Data->Y[i] - PawnBase->Data->MinY) / (PawnBase->Data->MaxY - PawnBase->Data->MinY) * canvasHeight / 4;
int32 y2 = (PawnBase->Data->Z[i] - PawnBase->Data->MinZ) / (PawnBase->Data->MaxZ - PawnBase->Data->MinZ) * canvasHeight / 4;
int32 y3 = (PawnBase->Data->U[i] - PawnBase->Data->MinU) / (PawnBase->Data->MaxU - PawnBase->Data->MinU) * canvasHeight / 4;
int32 y4 = (PawnBase->Data->V[i] - PawnBase->Data->MinV) / (PawnBase->Data->MaxV - PawnBase->Data->MinV) * canvasHeight / 4;
int32 y5 = (PawnBase->Data->W[i] - PawnBase->Data->MinW) / (PawnBase->Data->MaxW - PawnBase->Data->MinW) * canvasHeight / 4;
int32 y0;
float Diff = (PawnBase->Data->MaxX - PawnBase->Data->MinX);
if (Diff != 0)
{
y0 = (PawnBase->Data->X[i] - PawnBase->Data->MinX) / Diff * canvasHeight / 4;
}
else
{
y0 = 0;
}
int32 y1;
Diff = (PawnBase->Data->MaxY - PawnBase->Data->MinY);
if (Diff != 0)
{
y1 = (PawnBase->Data->Y[i] - PawnBase->Data->MinY) / Diff * canvasHeight / 4;
}
else
{
y1 = 0;
}
int32 y2;
Diff = (PawnBase->Data->MaxZ - PawnBase->Data->MinZ);
if (Diff != 0)
{
y2 = (PawnBase->Data->Z[i] - PawnBase->Data->MinZ) / Diff * canvasHeight / 4;
}
else
{
y2 = 0;
}
int32 y3;
Diff = (PawnBase->Data->MaxU - PawnBase->Data->MinU);
if (Diff != 0)
{
y3 = (PawnBase->Data->U[i] - PawnBase->Data->MinU) / Diff * canvasHeight / 4;
}
else
{
y3 = 0;
}
int32 y4;
Diff = (PawnBase->Data->MaxV - PawnBase->Data->MinV);
if (Diff != 0)
{
y4 = (PawnBase->Data->V[i] - PawnBase->Data->MinV) / Diff * canvasHeight / 4;
}
else
{
y4 = 0;
}
int32 y5;
Diff = (PawnBase->Data->MaxW - PawnBase->Data->MinW);
if (Diff != 0)
{
y5 = (PawnBase->Data->W[i] - PawnBase->Data->MinW) / Diff * canvasHeight / 4;
}
else
{
y5 = 0;
}
uint8 r, g, b;
if (PawnBase->Data->IsBrushed[i])
......
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