Closed B0ney closed 6 months ago
I found another example with text_input
:
use iced::widget::{column, container, text_input};
use iced::{Element, Sandbox};
// Long text mustn't contain symbols otherwise the renderer will wrap the text.
static LONG: &'static str = "looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong";
pub fn main() -> iced::Result {
Example::run(iced::Settings {
window: iced::window::Settings {
size: iced::Size::from([500.0, 500.0]),
..iced::window::Settings::default()
},
..Default::default()
})
}
#[derive(Debug, Default)]
struct Example {
text: String,
}
#[derive(Debug, Clone)]
enum Message {
Text(String),
}
impl Sandbox for Example {
type Message = Message;
fn new() -> Self {
Example {
text: LONG.to_owned(),
}
}
fn title(&self) -> String {
"skia-bounding".into()
}
fn theme(&self) -> iced::Theme {
iced::Theme::Dark
}
fn update(&mut self, message: Message) {
match message {
Message::Text(txt) => self.text = txt,
}
}
fn view(&self) -> Element<Message> {
let textbox = text_input("placeholder", &self.text).on_input(Message::Text);
let inner = container(
column![textbox], // Must be inside a Column
)
.padding(50); // Set padding to see text bleeding outside
container(inner).into()
}
}
Agree smae issue, for OSX, linux(wayland)
Is there an existing issue for this?
Is this issue related to iced?
What happened?
I'm not sure if this applies to other elements, but I noticed that if a button contains really long, unwrapped text, and is inside another element, with the
tiny-skia
renderer, the text bleeds out.It was a little tricky to create an sscce, but here's the code to reproduce it:
To add in
cargo.toml
:Result:
Putting it into a scrollable and moving it results in this:
What is the expected behavior?
Compiling the sscce with
features=wgpu
produces the expected outcome:Version
master
Operating System
Windows
Do you have any log output?
No response