namespace FastReport.Export.Svg
{
///
/// Specifies the alignment methods
///
public enum Align
{
///
/// Do not force uniform scaling. Scale the graphic content of the given element non-uniformly
/// if necessary such that the element's bounding box exactly matches the viewport rectangle.
///
none,
///
/// Force uniform scaling. Align the min-x of the element's viewBox with the smallest X value
/// of the viewport. Align the min-y of the element's viewBox with the smallest Y value of the viewport.
///
xMinYMin,
///
/// Force uniform scaling. Align the midpoint X value of the element's viewBox with the midpoint
/// X value of the viewport. Align the min-y of the element's viewBox with the smallest Y value
/// of the viewport.
///
xMidYMin,
///
/// Force uniform scaling. Align the min-x+width of the element's viewBox with the maximum X value
/// of the viewport. Align the min-y of the element's viewBox with the smallest Y value of the viewport.
///
xMaxYMin,
///
/// Force uniform scaling. Align the min-x of the element's viewBox with the smallest X value of
/// the viewport. Align the midpoint Y value of the element's viewBox with the midpoint Y value
/// of the viewport.
///
xMinYMid,
///
/// The default. Force uniform scaling. Align the midpoint X value of the element's viewBox
/// with the midpoint X value of the viewport. Align the midpoint Y value of the element's
/// viewBox with the midpoint Y value of the viewport.
///
xMidYMid,
///
/// Force uniform scaling. Align the min-x+width of the element's viewBox with the maximum X
/// value of the viewport. Align the midpoint Y value of the element's viewBox with the midpoint
/// Y value of the viewport.
///
xMaxYMid,
///
/// Force uniform scaling. Align the min-x of the element's viewBox with the smallest X value of
/// the viewport. Align the min-y+height of the element's viewBox with the maximum Y value of the viewport.
///
xMinYMax,
///
/// Force uniform scaling. Align the midpoint X value of the element's viewBox with the midpoint X
/// value of the viewport. Align the min-y+height of the element's viewBox with the maximum Y value
/// of the viewport.
///
xMidYMax,
///
/// Force uniform scaling. Align the min-x+width of the element's viewBox with the maximum X value of
/// the viewport. Align the min-y+height of the element's viewBox with the maximum Y value of the viewport.
///
xMaxYMax
}
///
/// Specifies the svg scale types
///
public enum MeetOrSlice
{
///
/// (the default) - Scale the graphic such that:
/// - aspect ratio is preserved
/// - the entire viewBox is visible within the viewport
/// - the viewBox is scaled up as much as possible, while still meeting the other criteria
///
meet,
///
/// Scale the graphic such that:
/// - aspect ratio is preserved
/// - the entire viewport is covered by the viewBox
/// - the viewBox is scaled down as much as possible, while still meeting the other criteria
///
slice
}
///
/// Describes scaling of a svg documents
///
public class AspectRatio
{
private Align align;
private MeetOrSlice? meetOrSlice;
///
/// Gets the align value
///
public Align Align { get { return align; } }
///
/// Gets the meetOrSlice value
///
public MeetOrSlice? MeetOrSlice { get { return meetOrSlice; } }
///
/// Initializes a new instance of the class.
///
///
public AspectRatio(Align align)
{
this.align = align;
}
///
/// Initializes a new instance of the class.
///
/// Align value
/// meetOrSlice value
public AspectRatio(Align align, MeetOrSlice meetOrSlice) : this(align)
{
this.meetOrSlice = meetOrSlice;
}
}
}