UI text jumps up and down at every key
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
Línea de trabajo
Empieza en scroll.rs, en TextViewport::reveal_caret, y sigue las ramas que se usan cuando una línea de texto es más alta que el área del cursor. Reproduce el problema con el ejemplo de Bevy 0.20.1 del issue y observa viewport.offset.y mientras escribes o mueves el cursor. El trabajo estará terminado cuando el offset permanezca centrado para una línea demasiado alta, en lugar de alternar entre 0 y 2.4.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 50k
- Forks
- 5.1k
- Merge medio
- 2 d 20 h
- PR fusionados (30 d)
- 129
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bevyengine/bevy
-
C-Bug S-Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bevyengine/bevy#26689 ·
Los mantenedores suelen responder en 2 días
-
Volumetric fog: a `FogVolume` with `Visibility::Hidden` is still renderedPosiblemente ocupada @adityawrk la tomó hace 2 días. AbiertoC-Bug S-Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
bevyengine/bevy#26688 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
bevyengine/bevy#26684 ·
Los mantenedores suelen responder en 2 días
-
Create a bevy_fuzzy examplePosiblemente ocupada @Tatsuya0330 la tomó hace 1 día. AbiertoA-UI C-Examples C-Feature D-Straightforward S-Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bevyengine/bevy#26676 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bevyengine/bevy#26649 ·
Los mantenedores suelen responder en 2 días
Todos los issues de bevyengine/bevy
Issues similares
-
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)Posiblemente ocupada @ealwanlee la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
psmux/psmux-plugins#47 ·
-
Link Checker ReportAbiertoautomated issue report
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
ratatui/awesome-ratatui#598 ·
Los mantenedores suelen responder en 1 día
-
area:core priority:high status:ready type:security
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
release
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
github/gh-aw-mcpg#17603 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día