diff --git a/Interaction/Widgets/vtkDistanceRepresentation.h b/Interaction/Widgets/vtkDistanceRepresentation.h index fa6939535751630ace751f077fe742d57991b499..2c69313269715896fd0edaed40998fcb3c084448 100644 --- a/Interaction/Widgets/vtkDistanceRepresentation.h +++ b/Interaction/Widgets/vtkDistanceRepresentation.h @@ -97,8 +97,8 @@ public: // will be defined in terms of the scaled space. For example, if the VTK world // coordinates are assumed to be in inches, but the desired distance units // should be defined in terms of centimeters, the scale factor should be set - // to 0.3937. The ruler marks will then be spaced in terms of centimeters, and - // the label will contain the measurement in centimeters. + // to 2.54. The ruler marks will then be spaced in terms of centimeters, and + // the label will show the measurement in centimeters. vtkSetMacro(Scale,double); vtkGetMacro(Scale,double); diff --git a/Interaction/Widgets/vtkDistanceRepresentation2D.cxx b/Interaction/Widgets/vtkDistanceRepresentation2D.cxx index 4c9ab7e240e9d9509756db1fc9378144226d828a..7ea56c6a7083a2e719001e00b2d23ab6378c2b8f 100644 --- a/Interaction/Widgets/vtkDistanceRepresentation2D.cxx +++ b/Interaction/Widgets/vtkDistanceRepresentation2D.cxx @@ -183,16 +183,14 @@ void vtkDistanceRepresentation2D::BuildRepresentation() this->AxisActor->GetPoint1Coordinate()->SetValue(p1); this->AxisActor->GetPoint2Coordinate()->SetValue(p2); this->AxisActor->SetRulerMode(this->RulerMode); - this->AxisActor->SetRulerDistance(this->RulerDistance * this->Scale); - this->AxisActor->SetNumberOfLabels(this->NumberOfRulerTicks); - - double scaledDistance = this->Distance; if (this->Scale != 0.0) { - scaledDistance /= this->Scale; + this->AxisActor->SetRulerDistance(this->RulerDistance / this->Scale); } + this->AxisActor->SetNumberOfLabels(this->NumberOfRulerTicks); + char string[512]; - sprintf(string, this->LabelFormat, scaledDistance); + sprintf(string, this->LabelFormat, this->Distance * this->Scale); this->AxisActor->SetTitle(string); this->BuildTime.Modified();