Skip to content

Commit fa72097

Browse files
committed
Minor documentation
1 parent 8b2c97e commit fa72097

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

gdnative-core/src/core_types/geom/transform2d.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,11 @@ impl Transform2D {
7878
/// Constructs the transform from a given angle (in radians), translation, and scale.
7979
///
8080
/// # Deprecation
81-
/// This constructor has been deprecated due to the order of transformations applied deviate from one's expectations. An identity transform is translated, rotated, and scaled. Using a non-zero rotation will affect the resulting transform's origin.
81+
/// This constructor has been deprecated due to the order of transformations applied deviate from one's expectations.
82+
/// Using a non-zero rotation will affect the resulting transform's origin.
8283
///
8384
/// Consider using [`Transform2D::from_scale_rotation_origin`] or applying transformations manually.
84-
#[deprecated(
85-
note = "This constructor is misleading because a non-zero rotation would affect the resulting origin. Consider using Transform2D::from_scale_rotation_origin or apply transformations manually."
86-
)]
85+
#[deprecated = "Misleading behavior (see description); consider `from_scale_rotation_origin` or manual transformations."]
8786
#[inline]
8887
pub fn from_rotation_translation_scale(
8988
translation: Vector2,
@@ -98,7 +97,13 @@ impl Transform2D {
9897

9998
/// Constructs the transform from a given scale, angle (in radians), and origin.
10099
///
101-
/// This is **NOT** equivalent to `Transform2D::IDENTITY.scaled(scale).rotated(rotation).translated(origin)` or `Transform2D::IDENTITY.translated(origin).rotated(rotation).scaled(scale)`. Those transformations do not preserve the given origin, see the documentation for [`rotated`], [`scaled`], and [`translated`] for more information.
100+
/// This is **NOT** equivalent to either of these two lines:
101+
/// ```ignore
102+
/// Transform2D::IDENTITY.scaled(scale).rotated(rotation).translated(origin)
103+
/// Transform2D::IDENTITY.translated(origin).rotated(rotation).scaled(scale)
104+
/// ```
105+
///
106+
/// Those transformations do not preserve the given origin; see documentation for [`rotated`], [`scaled`], and [`translated`].
102107
///
103108
/// [`rotated`]: Self::rotated
104109
/// [`scaled`]: Self::scaled

0 commit comments

Comments
 (0)