From 3ca5bf28c56b13b5c8d7b6759df238c8bb04bf2e Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Sun, 13 Sep 2026 14:31:16 +0900 Subject: [PATCH] conventions: say why flip is spelled the Godot way MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `flip_h` / `flip_v` with `is_flipped_*` readers is a departure: every sibling Player calls this pair `flipX` / `flipY`. It is the right call here — `Sprite2D` and `AnimatedSprite2D` already put `flip_h` on a 2D node, so that is what a Godot user reaches for, and an inspector row called `flip_x` sitting beside a Sprite2D's `flip_h` would read as a different feature rather than the same one. None of which was written down. §7 of the API conventions asks for the reason next to the code precisely because a departure with no stated reason is indistinguishable from a mistake to whoever reads it next — and the next reader of this file is someone auditing it against the family, who has no way to tell this from the drift they are hunting. Comment only. Rebuilt with scripts/build-extension.sh (compiles and links; the duplicate `_rust_eh_personality` warning is pre-existing) and ran scripts/run-tests.sh: 35 cases, 101 assertions, 0 failed, 0 skipped. Note for whoever runs that next — the first invocation after a build segfaults in the editor's layout load once the suite has already printed SUITE FINISHED, and the script still exits 0. A re-run is clean. Worth knowing, since an exit code of 0 after a crash is not a result. --- ss_player/ss_player_node_2d.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ss_player/ss_player_node_2d.cpp b/ss_player/ss_player_node_2d.cpp index f600c93..d05da3b 100644 --- a/ss_player/ss_player_node_2d.cpp +++ b/ss_player/ss_player_node_2d.cpp @@ -350,6 +350,13 @@ void SpriteStudioPlayer2D::set_audio_backend(const Ref } Ref SpriteStudioPlayer2D::get_audio_backend() const { return _audio_backend; } +// Spelled the Godot way, not the family's. Every sibling Player calls this pair +// `flipX` / `flipY`; here it is `flip_h` / `flip_v` with an `is_flipped_*` +// reader, because that is what `Sprite2D` and `AnimatedSprite2D` already put on +// a 2D node — a Godot user reaches for `flip_h` on anything that draws, and an +// inspector row called `flip_x` next to a Sprite2D's `flip_h` would read as a +// different feature. A departure with a reason, per the API conventions +// (SDK: 20_design/40_api_conventions.md, "Departing from this document"). void SpriteStudioPlayer2D::set_flip_h(bool p_flip) { _flip_h = p_flip; _update_root_transform();