API Region GetScale

s, abstract rectangular areas on the screen to position user interface elements, provide two methods to determine the current scale affecting the region's size and position:
 * GetScale returns the scale relative to the region's immediate parent; this is the same value defined using (scale)
 * GetEffectiveScale returns the net scaling that is the product of the region's scale and that of its parents

scale= region:GetScale effectiveScale = region:GetEffectiveScale

Returns

 * scale : Number - The region's scale relative to its immediate parent (if it has one)
 * effectiveScale : Number - The region's net scale, inclusive of its parent's effective scale

Example
The following example shows local frame1 = CreateFrame("Frame") local frame2 = CreateFrame("Frame", nil, frame1) -- frame2 is a child of frame1 frame1:SetScale(0.5) frame2:SetScale(0.5) print(frame2:GetScale)                         -- 0.5 print(frame2:GetEffectiveScale)                -- 0.25

It is possible, albeit inefficient and unnecessary, to compute the effective scale using GetScale alone function ComputeEffectiveScale(region) local scale = 1 while region do                           scale = scale * region:GetScale if (region:IsIgnoringParentScale) then return scale end region = region:GetParent end return scale end

Details

 * Effective scale affects a region's placement and size, by multipling the cooridnate space used by many of its properties. These include (non-exhaustive list):
 * - Affects the optional xOff and yOff arguments, positioning the frame nearer or further from an anchor point
 * - Affects the width and height dimensions, if these were not already defined using fixed anchor points
 * Notwithstanding, (true) will cause a region's effective scale to only be its own scale