Incorrect text scaling in vtkAxisActor2D.cxx
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
There seems to be an error in the vtkAxisActor2D class when enabling automatic sizing of the text relative to the axes. In some cases the text gets bigger when zooming out, instead of getting smaller.
The source code of the problem is the following:
if ( this->SizeFontRelativeToAxis ) { xp1 = this->PositionCoordinate->GetComputedDoubleDisplayValue(viewport); xp2 = this->Position2Coordinate->GetComputedDoubleViewportValue(viewport); len = sqrt((xp2[0]-xp1[0])(xp2[0]-xp1[0]) + (xp2[1]-xp1[1])(xp2[1]-xp1[1])); }
The distance between the lower left and the upper right coordinate is computed, but the coordinates are in different coordinate systems. Changing the computation of xp1 to "this->PositionCoordinate->GetComputedDoubleViewportValue(viewport);" will fix the problem. (see picture)