コンテンツにスキップ

Alignment 構造体

矩形内の位置を中心からの正規化された相対座標で表す不変値です。

名前空間: FloatSoda.Geometrics
アセンブリ: FloatSoda.dll

public readonly record struct Alignment : IEquatable<Alignment>

IEquatable<Alignment>

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

矩形内の位置を中心からの正規化された相対座標で表す不変値です。

public Alignment(float X = 0, float Y = 0)

X float

水平方向の相対位置。-1は左端、0は中央、1は右端です。既定値は0です。

Y float

垂直方向の相対位置。-1は上端、0は中央、1は下端です。既定値は0です。

Offset

下端中央を表す配置値を取得します。

public static readonly Alignment BottomCenter

Alignment

左下を表す配置値を取得します。

public static readonly Alignment BottomLeft

Alignment

右下を表す配置値を取得します。

public static readonly Alignment BottomRight

Alignment

中央を表す配置値を取得します。

public static readonly Alignment Center

Alignment

左端中央を表す配置値を取得します。

public static readonly Alignment CenterLeft

Alignment

右端中央を表す配置値を取得します。

public static readonly Alignment CenterRight

Alignment

上端中央を表す配置値を取得します。

public static readonly Alignment TopCenter

Alignment

左上を表す配置値を取得します。

public static readonly Alignment TopLeft

Alignment

右上を表す配置値を取得します。

public static readonly Alignment TopRight

Alignment

水平方向の相対位置。-1は左端、0は中央、1は右端です。既定値は0です。

public float X { get; init; }

float

垂直方向の相対位置。-1は上端、0は中央、1は下端です。既定値は0です。

public float Y { get; init; }

float

親矩形内で子矩形をこの配置に置くための左上座標を算出します。

public Offset ComputeOffset(SKSize parent, SKSize child)

parent SKSize

親矩形の大きさ。単位は論理ピクセルです。

child SKSize

子矩形の大きさ。単位は論理ピクセルです。

Offset

親矩形の左上を原点とする、子矩形左上の論理ピクセル単位のオフセット。

水平および垂直方向を中央に対して反転した配置値を返します。

public Alignment FlipAll()

Alignment

両成分の符号を反転した新しい配置値。

水平方向を中央に対して反転した配置値を返します。

public Alignment FlipX()

Alignment

水平成分の符号だけを反転した新しい配置値。

垂直方向を中央に対して反転した配置値を返します。

public Alignment FlipY()

Alignment

垂直成分の符号だけを反転した新しい配置値。

指定された矩形サイズの中心を原点として、この配置が示す位置を算出します。

public Offset Pivot(SKSize size)

size SKSize

基準とする矩形の大きさ。単位は論理ピクセルです。

Offset

矩形中心から配置位置までの論理ピクセル単位のオフセット。

Offset