forked from emilk/egui
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- `row_start_x` tracks a virtual position in the source paragraph (the one that is too long) for which length has already been processed. When creating an empty row, this position should not be updated as no glyphs were consumed from the source paragraph. - added example that would demonstrate the problem if the line was included, and that is fixed with this commit
- Loading branch information
1 parent
f4b39ec
commit 28407b8
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "wrapping-layout" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
eframe = { path = "../../crates/eframe", features = [ | ||
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO | ||
] } | ||
tracing-subscriber = "0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use eframe::{ | ||
egui::{self, TextFormat}, | ||
epaint::text::LayoutJob, | ||
}; | ||
|
||
fn main() -> Result<(), eframe::Error> { | ||
let native_options = eframe::NativeOptions::default(); | ||
eframe::run_native( | ||
"My egui App", | ||
native_options, | ||
Box::new(|cc| Box::new(MyEguiApp::new(cc))), | ||
) | ||
} | ||
|
||
#[derive(Default)] | ||
struct MyEguiApp {} | ||
|
||
impl MyEguiApp { | ||
fn new(_cc: &eframe::CreationContext<'_>) -> Self { | ||
Self::default() | ||
} | ||
} | ||
|
||
impl eframe::App for MyEguiApp { | ||
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { | ||
egui::CentralPanel::default().show(ctx, |ui| { | ||
ui.horizontal_wrapped(|ui| { | ||
ui.hyperlink_to("@npub1vdaeclr2mnntmyw...", "whocares"); | ||
let text = " lnbc10u1p3lz4dppp5dsj2mh5kgqfqqxwhkrkw60stn8aph4gm2h2053xvwvvlvjm3q9eqdpqxycrqvpqd3hhgar9wfujqarfvd4k2arncqzpgxqzz6sp5vfenc5l4uafsky0w069zs329edf608ggpjjveguwxfl3xlswg5vq9qyyssqj46d5x3gsnljffm79eqwszk4mk47lkxywdp8mxum7un3qm0ztwj9jf46cm4lw2un9hk4gttgtjdrk29h27xu4e3ume20sqsna8q7xwspqqkwq7"; | ||
let job = LayoutJob::single_section(text.to_owned(), TextFormat::default()); | ||
ui.label(job); | ||
}); | ||
}); | ||
} | ||
} |