Skip to content

Commit

Permalink
input: Fix Input to vertical center mask chars.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Jan 29, 2025
1 parent 6fa1888 commit f5ce9ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/ui/src/input/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,10 @@ impl Element for TextElement {
let origin = bounds.origin;

let mut offset_y = px(0.);
if self.input.read(cx).masked {
// Move down offset for vertical centering the *****
offset_y = px(2.5);
}
for line in prepaint.lines.iter() {
let p = point(origin.x, origin.y + offset_y);
_ = line.paint(p, line_height, window, cx);
Expand Down

0 comments on commit f5ce9ce

Please sign in to comment.