Commit 8c332511 authored by Aashish Chaudhary's avatar Aashish Chaudhary
Browse files

Fixed offset issue which was causing uneven positioning

The issue was related to using wrong pivot point. Now the text should
be evenly placed whether its get flipped or not

Change-Id: Iea02e16d45aa399d5e4411c27d98da9c56ac6b02
parent f6d6088b
......@@ -104,7 +104,7 @@ int TestCubeAxes3( int argc, char * argv [] )
axes2->SetYLabelFormat("%6.1f");
axes2->SetZLabelFormat("%6.1f");
axes2->SetFlyModeToClosestTriad();
axes2->SetScreenSize(15.0);
axes2->SetScreenSize(20.0);
ren2->AddViewProp(axes2.GetPointer());
renWin->Render();
......
......@@ -206,14 +206,7 @@ void vtkAxesFollower::ComputeTransformMatrix(vtkRenderer *ren)
if(this->AutoCenter)
{
// Offset by half of width & height so that pivot is at center
// of the geometry.
double *bounds = this->GetMapper()->GetBounds();
double halfWidth = (bounds[1] - bounds[0]) * 0.5;
double halfHeight = (bounds[3] - bounds[2]) * 0.5;
pivotPoint[0] = this->Origin[0] + halfWidth;
pivotPoint[1] = this->Origin[1] + halfHeight;
this->GetMapper()->GetCenter(pivotPoint);
}
// Move to pivto point.
......
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