SceneViewBox Class

The view box of a group (SceneGroup.ViewBox), as a nested SVG svg element: a rectangle of the coordinates of the children, mapped to a viewport of the coordinates of the group, which cuts what is outside of it.

public sealed class SceneViewBox : IEquatable<SceneViewBox>
Implements

Constructors

NameDescription
SceneViewBox(SceneBounds, SceneBounds)The view box of a group (SceneGroup.ViewBox), as a nested SVG svg element: a rectangle of the coordinates of the children, mapped to a viewport of the coordinates of the group, which cuts what is outside of it.

SceneViewBox(SceneBounds, SceneBounds)

SceneViewBox.cs

The view box of a group (SceneGroup.ViewBox), as a nested SVG svg element: a rectangle of the coordinates of the children, mapped to a viewport of the coordinates of the group, which cuts what is outside of it.

public SceneViewBox(SceneBounds Box, SceneBounds Viewport)

Parameters

Box SceneBounds
The rectangle of the coordinates of the children that is shown, as the SVG viewBox.
Viewport SceneBounds
The rectangle it is shown in, in the coordinates of the group (inside its SceneElement.Transform).

Properties

NameDescription
AlignmentGets how the box keeps its proportions in the viewport. The default is SceneAspectRatio.XMidYMid, as in SVG.
BoxThe rectangle of the coordinates of the children that is shown, as the SVG viewBox.
SliceGets a value that indicates whether the box covers the whole viewport and is cut (slice), rather than fitting in it (meet, the default). It does not apply when SceneViewBox.Alignment is SceneAspectRatio.None.
ViewportThe rectangle it is shown in, in the coordinates of the group (inside its SceneElement.Transform).

Gets how the box keeps its proportions in the viewport. The default is SceneAspectRatio.XMidYMid, as in SVG.

public SceneAspectRatio Alignment { get; init; }

Property value

SceneAspectRatio

The rectangle of the coordinates of the children that is shown, as the SVG viewBox.

public SceneBounds Box { get; init; }

Property value

SceneBounds

Gets a value that indicates whether the box covers the whole viewport and is cut (slice), rather than fitting in it (meet, the default). It does not apply when SceneViewBox.Alignment is SceneAspectRatio.None.

public bool Slice { get; init; }

Property value

bool

The rectangle it is shown in, in the coordinates of the group (inside its SceneElement.Transform).

public SceneBounds Viewport { get; init; }

Property value

SceneBounds

Methods

NameDescription
Deconstruct(SceneBounds, SceneBounds)
Equals(SceneViewBox?)
Equals(object?)
GetHashCode()
GetTransform()Gets the transform from the coordinates of the children to the coordinates of the group, as SVG computes it.
ToString()

Deconstruct(SceneBounds, SceneBounds)

public void Deconstruct(out SceneBounds Box, out SceneBounds Viewport)

Parameters

Box SceneBounds
Viewport SceneBounds

No documentation is available.

Equals overloads

Equals(SceneViewBox?)

public bool Equals(SceneViewBox? other)
Parameters
other SceneViewBox?
Returns

bool

No documentation is available.

Equals(object?)

public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

GetHashCode()

public override int GetHashCode()

Returns

int

No documentation is available.

GetTransform()

SceneViewBox.cs

Gets the transform from the coordinates of the children to the coordinates of the group, as SVG computes it.

public SceneTransform? GetTransform()

Returns

SceneTransform? The transform, or null when the box or the viewport has no area or a coordinate that is not finite: nothing is drawn.

ToString()

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(SceneViewBox?, SceneViewBox?)
operator !=(SceneViewBox?, SceneViewBox?)

operator ==(SceneViewBox?, SceneViewBox?)

public static bool operator ==(SceneViewBox? left, SceneViewBox? right)

Parameters

left SceneViewBox?
right SceneViewBox?

Returns

bool

No documentation is available.

operator !=(SceneViewBox?, SceneViewBox?)

public static bool operator !=(SceneViewBox? left, SceneViewBox? right)

Parameters

left SceneViewBox?
right SceneViewBox?

Returns

bool

No documentation is available.