Skip to content

Deprecate the values of ObjectShape::Point - #346

Merged
bjorn merged 1 commit into
nextfrom
deprecate-point-xy
Jul 6, 2026
Merged

bjorn merged 1 commit into
nextfrom
deprecate-point-xy

Conversation

@bjorn

@bjorn bjorn commented Jul 6, 2026

Copy link
Copy Markdown
Member

The values of ObjectShape::Point(f32, f32) merely duplicate the object's own x and y members, and the TMX <point> element has no attributes of its own, so they were inconsistent with the other shape variants (see #329).

Rust supports #[deprecated] on individual tuple-variant fields, which gives exactly the behavior we want here:

  • Binding or constructing the values warns, pointing at the object's x/y members instead.
  • Merely handling the variant with ObjectShape::Point(..) stays warning-free, so consumers who don't rely on the redundant values are unaffected.

The variant doc explains the migration, and the values can then be dropped entirely in the release after 0.16.

Closes #329

They merely duplicate the object's x and y members, and the TMX
<point> element has no attributes of its own. The variant itself
remains; matching it with ObjectShape::Point(..) avoids the
deprecation warnings.

Closes #329
@bjorn
bjorn merged commit d25e04d into next Jul 6, 2026
4 checks passed
@bjorn
bjorn deleted the deprecate-point-xy branch July 6, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant