System.Types.TRectF.Fit

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Fit(const BoundsRect: TRectF): Single; // deprecated 'Please consider using FitInto instead.';

Properties

Type Visibility Source Unit Parent
function public System.Types.pas System.Types TRectF

Description

Resizes the dimensions of the current rectangle object to best fit (keeping the rectangle proportions) into the specified rectangle.

Fit returns the implemented scaling ratio. If the returned value < 1, then the current rectangle is not resized.

Fit resizes the dimensions of the current rectangular object to best fit (keeping the current rectangle proportions) into the specified BoundsRect rectangle:

  • If any dimension of the current rectangle is larger than the BoundsRect rectangle, then decrease the current rectangle size (keeping current rectangle proportions--the ratio between the width and height) to fit all the current rectangle in the BoundsRect rectangle. That is, either the width of the current scaled rectangle is equal to the width of the BoundsRect rectangle or the height of the current scaled rectangle is equal to the height of the BoundsRect rectangle. All the current rectangle should be placed into the specified BoundsRect rectangle. The current rectangle is placed centered in the BoundsRect rectangle.
    IwFit
  • If the original current rectangle is smaller than the BoundsRect rectangle, then the current rectangle is not resized. The current rectangle is placed centered in the BoundsRect rectangle.
    IwFit

See Also