Struct HudElementBasis
The scale, per-axis stretch and rotation an element carries at one instant, in its own displayed (pre-mirror) space.
Inherited Members
Namespace: Serenity.GameUi.Application.Placement
Assembly: Serenity.GameUi.Application.dll
Syntax
public readonly struct HudElementBasis
Remarks
The affine map a gesture applies to a local point is R(θ)·S(Scale·StretchX, Scale·StretchY)·p:
the element is stretched along its own axes first, then the whole result is rotated. Scale and stretch
only ever appear multiplied together — Transform(float, float) is the one place that product is taken —
which is what keeps a uniform Resize and a per-axis Deform sharing the same compensation
maths without either one needing to know about the other.
Constructors
HudElementBasis(float, float, float, float)
Creates a basis.
Declaration
public HudElementBasis(float scale, float stretchX, float stretchY, float rotationDegrees)
Parameters
| Type | Name | Description |
|---|---|---|
| float | scale | The uniform scale. |
| float | stretchX | The stretch along the local X axis. |
| float | stretchY | The stretch along the local Y axis. |
| float | rotationDegrees | The rotation, in displayed-space degrees. |
Fields
RotationDegrees
The rotation, in displayed-space degrees.
Declaration
public readonly float RotationDegrees
Field Value
| Type | Description |
|---|---|
| float |
Scale
The uniform scale.
Declaration
public readonly float Scale
Field Value
| Type | Description |
|---|---|
| float |
StretchX
The stretch along the element's own local X axis, applied before rotation.
Declaration
public readonly float StretchX
Field Value
| Type | Description |
|---|---|
| float |
StretchY
The stretch along the element's own local Y axis, applied before rotation.
Declaration
public readonly float StretchY
Field Value
| Type | Description |
|---|---|
| float |
Methods
Transform(float, float)
Maps a local point through this basis: stretched along its own axes, then rotated.
Declaration
public (float X, float Y) Transform(float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The local X coordinate. |
| float | y | The local Y coordinate. |
Returns
| Type | Description |
|---|---|
| (float X, float Y) | The transformed point. |
Remarks
The stretch is folded into x/y before the rotation, and the
uniform Scale is applied to the rotated result afterwards — mathematically the same
thing (Scale is common to both axes, so it commutes across the rotation), but this ordering is
what makes the case StretchX = StretchY = 1 reproduce the exact
arithmetic — the same double-precision subtraction, the same single cast, the same one float
multiply — that this solver used before stretch existed at all.