UI text jumps up and down at every key
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
調査の方向性
scroll.rs の TextViewport::reveal_caret から始め、テキスト行がキャレット領域より高い場合に使われる分岐をたどってください。issue の Bevy 0.20.1 の例で再現し、入力中またはキャレットの移動中に viewport.offset.y を観察してください。行が大きすぎる場合に、オフセットが 0 と 2.4 の間で交互に変わるのではなく、中央に保たれれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Bevy version and features
0.20.1. Main is still affected: its scroll.rs last changed in c1b48d6, the #25948 fix.
#25305 ("Text in EditText bounces up and down for every change"), closed by #25948. That fix only adds a 0.001 tolerance, so it helps only when the line is less than 0.002 px taller than the box.
Relevant system information
Windows 10 Pro 19045, RTX 5080, Vulkan.
What you did
Run the app below, then type into the field or move the caret with the arrow keys.
The app (Bevy 0.20.1, default features)
use bevy::input_focus::AutoFocus;
use bevy::prelude::*;
use bevy::text::{EditableText, TextCursorStyle};
use bevy::ui_widgets::TextInput;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.add_systems(Last, log_offset)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn(Camera2d);
commands.spawn((
Node {
width: px(320),
height: px(40),
padding: UiRect::axes(px(10), px(6)),
border: px(2).all(),
margin: auto().all(),
..default()
},
BorderColor::from(Color::WHITE),
TextInput,
EditableText::new("Bevy"),
TextFont {
font_size: FontSize::Px(22.0),
..default()
},
TextCursorStyle::default(),
AutoFocus,
));
}
fn log_offset(inputs: Query<&EditableText, Changed<EditableText>>) {
for input in &inputs {
info!("viewport.offset.y = {}", input.viewport.offset.y);
}
}
What went wrong
The text jumps up and down at every key. The viewport.offset.y log shows 2.4, 0, 2.4, 0.
Additional information
Why it's happaing
- The field's box inside the padding and border is 24 px high, and the 22 px font's line is 26.4 px.
- In
TextViewport::reveal_caret, a line taller than the caret area gets centered, at 1.2. - The next branch then snaps: back to the line's start (0) when the center is above the current offset, or to the bottom (2.4) when it's below, since there's no next line.
- Each reveal therefore flips the offset.
A possible fix direction: when the line is taller than the caret area, keep the centered offset instead of snapping to a line.
- 主要言語
- Rust
- スター
- 50k
- フォーク
- 5.1k
- 平均マージ
- 2日 20時間
- マージ済み PR(30日)
- 129
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bevyengine/bevy のほかの issue
-
C-Bug S-Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bevyengine/bevy#26689 ·
メンテナーはふだん 2 日以内に返信
-
Volumetric fog: a `FogVolume` with `Visibility::Hidden` is still rendered対応中かも @adityawrk が 2 日前に担当しました。 オープンC-Bug S-Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
bevyengine/bevy#26688 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
bevyengine/bevy#26684 ·
メンテナーはふだん 2 日以内に返信
-
Create a bevy_fuzzy example対応中かも @Tatsuya0330 が 1 日前に担当しました。 オープンA-UI C-Examples C-Feature D-Straightforward S-Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bevyengine/bevy#26676 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bevyengine/bevy#26649 ·
メンテナーはふだん 2 日以内に返信
bevyengine/bevy の issue をすべて見る
似ている issue
-
psmux-resurrect: restoring a session with a numeric name puts its windows into the wrong session (`new-window -t 4` is read as window 4)対応中かも @ealwanlee が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
psmux/psmux-plugins#47 ·
-
Link Checker Reportオープンautomated issue report
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
ratatui/awesome-ratatui#598 ·
メンテナーはふだん 1 日以内に返信
-
area:core priority:high status:ready type:security
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
release
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
github/gh-aw-mcpg#17603 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信