Skip to content

Commit

Permalink
Update builder.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored Dec 17, 2024
1 parent adfc0be commit ee85f81
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions crates/egui/src/widgets/text_edit/builder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::sync::Arc;

use emath::Rect;
use epaint::text::{cursor::CCursor, Galley, LayoutJob};

use crate::{
Expand Down Expand Up @@ -723,16 +722,6 @@ impl<'t> TextEdit<'t> {
}
}

// Allocate additional space if edits were made this frame that changed the size. This is important so that,
// if there's a ScrollArea, it can properly scroll to the cursor.
let extra_size = galley.size() - rect.size();
if extra_size.x > 0.0 || extra_size.y > 0.0 {
ui.allocate_rect(
Rect::from_min_size(outer_rect.max, extra_size),
Sense::hover(),
);
}

painter.galley(galley_pos, galley.clone(), text_color);

if has_focus {
Expand Down

0 comments on commit ee85f81

Please sign in to comment.