CODComponent::ValidateScale

BOOLCODComponent::ValidateScale(float&fScaleX, float&fScaleY, float&fOriginX, float&fOriginY)

Determines if the component can be scaled to the given ratios.

Defined in: OdComponent.cpp

Return Value

Boolean indicating if the given scaling ratios are valid.

Parameters

fScaleX

The horizontal scaling factor (in/out).

fScaleY

The vertical scaling factor (in/out).

fOriginX

X-origin for scaling operation.

fOriginY

Y-origin for scaling operation.

Comments

This function takes the current bounds of the component and scales it by the given X and Y ratios. The resulting rectangle is passed to the  ValidateSize function to determine if the resulting size is valid. If the size is not valid, the scaling factors are adjusted so that the resulting size matches the closest valid size. The current bounds are then scaled by the new scaling factors and the resulting rectangle is passed to  ValidatePosition to verify that the position is valid. If the position is not valid, then this function returns FALSE.