PreserveAspectRatioAttribute: preserveAspectRatio

Description Available Attribute Values Details Used by the Elements

Description

Governs the aspect ration preservation and alignment of an image when scaling.

Available Attribute Values

The value is defined as follows:

'<align>'

Specities the alignment directive (See details below)

'c( <defer>, <align>)'

Specifies both a defer directive and an alignment directive. (See details below)

'c(<align> <meet-or-Slice>)'

Specifies both an alignment directive and a meet-or-slice directive. (See details below)

'c( defer <align> <meet-or-Slice>)'

Specifies a defer, an alignment directive and a meet-or-slice directive. (See details below)

Details

A preserveAspectRatio value is a vector, which consists of mandatory alignment directive, possibly prepended with an optional defer directive and possibly postpended with an optional meet-or-slice directive.

The Align Directives (mandatory, pick one)

xMinYMin Place the viewBox in the top-left hand corner of the viewport, and force uniform scaling.
xMidYMin Place the viewBox at the top of the viewport and center it horizontally with respect to the viewport, and force uniform scaling.
xMaxYMin Place the viewBox at the top-left hand corner of the viewport, and force uniform scaling.
xMinYMid Place the viewBox to be centered at the left edge of the viewport, and force uniform scaling.
xMidYMid Place the viewBox to be centered at the center of the viewport, and force uniform scaling. This is the default.
xMaxYMid Place the viewBox to be centered at the right edge of the viewport, and force uniform scaling.
xMinYMax Place the viewBox at the lower-left hand corner of the viewport, and force uniform scaling.
xMidYMax Place the viewBox at the center of the bottom edge of the viewport, and force uniform scaling.
xMaxYMax Place the viewBox at the lower-lright hand corner of the viewport, and force uniform scaling.
none Scale the graphics so that the viewBox coinsides with the viewport and ignore any meet or slice directives.

(Note: if <align> is none, then the optional <meetOrSlice> value is ignored.)

The Meet-o-Slice Directives (optional)

meet Directive to scale up the graphic as such that the resulting viewBox is still contained within the viewPort, while still maintaining the original the aspect ratio.
slice Directive to scale up the graphic as such that the resulting viewBox just covers the viewPort, while still maintaining the original the aspect ratio.

The Defer Directive (optional):

defer Directive to instruct that any 'peserveAspectRation' value set in the content takes precedence.

Used by the Elements

Filter Primitive Elements

feImage

Graphics Referencing Elements

image

Non-structural Container Elements

marker, pattern

Structural Container Elements

svg, symbol

Uncategorized Elements

view


mslegrand/svgR documentation built on Jan. 21, 2020, 2:59 p.m.