Source/Fusion/Core/Layout/Scissor.cs
/// <summary>
/// Cuts away a part of the control
/// </summary>
/// <param name="content">The content to cut from</param>
/// <param name="edge">From which side of the content to cut from</param>
/// <param name="points">How much to cut, measured as the dimension of the cut away area orthogonal to edge</param>
/// <returns>A visually clipped control (desiring points less size)</returns>
Cuts away a part of the control
Cuts away a part of the control
public static IControl Scissor(this IControl content, RectangleEdge edge, Points points)
		{
			edge = edge.FlipVerticallyOnMac();
			return content
				.WithFrame(f => f.WithEdge(edge, f.GetEdge(edge).Add(edge.IsMinimal() ? new Points(-points) : points)))
				.Clip()
				.WithDimension(edge.NormalAxis(), content.DesiredSize[edge.NormalAxis()].Sub(points))
				;
		}
public static IControl Scissor ( this IControl content , RectangleEdge edge , Points points ) { edge = edge . FlipVerticallyOnMac ( ) ; return content . WithFrame ( f => f . WithEdge ( edge , f . GetEdge ( edge ) . Add ( edge . IsMinimal ( ) ? new Points ( - points ) : points ) ) ) . Clip ( ) . WithDimension ( edge . NormalAxis ( ) , content . DesiredSize [ edge . NormalAxis ( ) ] . Sub ( points ) ) ; }
Cuts away a part of the control
Cuts away a part of the control
A visually clipped control (desiring points less size)
A visually clipped control ( desiring points less size )
IControl
this
edge
RectangleEdge
From which side of the content to cut from
From which side of the content to cut from
points
Points
None
content
The content to cut from
The content to cut from