1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Add ui.set_row_height

This commit is contained in:
Emil Ernerfeldt
2021-03-21 14:44:59 +01:00
parent e20e3baa98
commit 953d2bb39b
5 changed files with 25 additions and 3 deletions

View File

@@ -238,8 +238,10 @@ impl ColoredText {
pub fn ui(&self, ui: &mut egui::Ui) {
for line in &self.0 {
ui.horizontal_wrapped_for_text(egui::TextStyle::Monospace, |ui| {
ui.spacing_mut().item_spacing.x = 0.0;
ui.horizontal_wrapped(|ui| {
ui.spacing_mut().item_spacing = egui::Vec2::ZERO;
ui.set_row_height(ui.fonts()[egui::TextStyle::Body].row_height());
for (style, range) in line {
let fg = style.foreground;
let text_color = egui::Color32::from_rgb(fg.r, fg.g, fg.b);