fix(text_input): always clip input text with the text bounds
this issue seems unique to tiny-skia
This commit is contained in:
parent
47ab72be50
commit
a44cff8011
2 changed files with 6 additions and 9 deletions
|
|
@ -18,7 +18,6 @@ features = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"xdg-portal",
|
"xdg-portal",
|
||||||
"a11y",
|
"a11y",
|
||||||
"wgpu",
|
|
||||||
"single-instance",
|
"single-instance",
|
||||||
"surface-message",
|
"surface-message",
|
||||||
"multi-window",
|
"multi-window",
|
||||||
|
|
|
||||||
|
|
@ -2740,14 +2740,14 @@ pub fn draw<'a, Message>(
|
||||||
effective_alignment(state.value.raw()),
|
effective_alignment(state.value.raw()),
|
||||||
);
|
);
|
||||||
|
|
||||||
if !cursors.is_empty() {
|
if cursors.is_empty() {
|
||||||
|
renderer.with_translation(Vector::ZERO, |_| {});
|
||||||
|
} else {
|
||||||
renderer.with_translation(Vector::new(alignment_offset - offset, 0.0), |renderer| {
|
renderer.with_translation(Vector::new(alignment_offset - offset, 0.0), |renderer| {
|
||||||
for (quad, color) in &cursors {
|
for (quad, color) in &cursors {
|
||||||
renderer.fill_quad(*quad, *color);
|
renderer.fill_quad(*quad, *color);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
renderer.with_translation(Vector::ZERO, |_| {});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let bounds = Rectangle {
|
let bounds = Rectangle {
|
||||||
|
|
@ -2785,11 +2785,9 @@ pub fn draw<'a, Message>(
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
if is_selecting {
|
// FIXME: we always must clip with a layer because of what appears to be a tiny-skia text clipping issue.
|
||||||
renderer.with_layer(bounds, render);
|
// Otherwise overflowing text escapes the bounds of the input.
|
||||||
} else {
|
renderer.with_layer(text_bounds, render);
|
||||||
render(renderer);
|
|
||||||
}
|
|
||||||
|
|
||||||
let trailing_icon_tree = children.get(child_index);
|
let trailing_icon_tree = children.get(child_index);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue