5internal static class EffectGeometry
7 internal static RectangleF GetRevealRect(
12 progress = Math.Clamp(progress, 0f, 1f);
14 if (progress <= 0f || bounds.Width <= 0f || bounds.Height <= 0f)
15 return RectangleF.Empty;
20 float width = bounds.Width * progress;
21 float height = bounds.Height * progress;
23 return direction
switch
25 EffectDirection.FromLeftToRight =>
26 new RectangleF(bounds.Left, bounds.Top, width, bounds.Height),
27 EffectDirection.FromRightToLeft =>
28 new RectangleF(bounds.Right - width, bounds.Top, width, bounds.Height),
29 EffectDirection.FromTopToBottom =>
30 new RectangleF(bounds.Left, bounds.Top, bounds.Width, height),
31 EffectDirection.FromBottomToTop =>
32 new RectangleF(bounds.Left, bounds.Bottom - height, bounds.Width, height),
33 EffectDirection.FromTopLeftToBottomRight =>
34 new RectangleF(bounds.Left, bounds.Top, width, height),
35 EffectDirection.FromTopRightToBottomLeft =>
36 new RectangleF(bounds.Right - width, bounds.Top, width, height),
37 EffectDirection.FromBottomLeftToTopRight =>
38 new RectangleF(bounds.Left, bounds.Bottom - height, width, height),
39 EffectDirection.FromBottomRightToTopLeft =>
40 new RectangleF(bounds.Right - width, bounds.Bottom - height, width, height),
EffectDirection
Specifies the direction in which a directional display effect travels.