Scale
A ratio of the size of an object as displayed on a document page to the size of a corresponding real-world object. Scale objects are used for measurement annotations. This class is immutable - you must create a new Scale object if you want to change any of the members.
Constructors
Creates an instance of a measurement Scale object.
Types
Properties
String representation of the source scale value. Returns the user-provided fractional input if available, otherwise formats as decimal.
String representation of the target scale value. Returns the user-provided fractional input if available, otherwise formats as decimal.
Functions
Equality is based on the display string, which includes user-provided descriptions (such as fractional input) or formatted float values. This means that two Scale objects with numerically equivalent values but different string representations (e.g., "3/4" vs "0.75") will not be considered equal. This is intentional, as users may expect the exact input to be preserved. For numeric equivalence, use numericEquals instead.
Compares this Scale to another for numeric equivalence, ignoring string representations. Returns true if the values and units are equal, regardless of input format. For example, Scale.fromStrings("3/4", IN, "1", FT) and Scale(0.75f, IN, 1f, FT) are numerically equal but not equal according to equals.