mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-13 20:53:07 +00:00
simplified offset calculation in dialogboxtitle
This commit is contained in:
parent
592ecf4c09
commit
f8e7427f75
@ -362,11 +362,8 @@ impl Dialog {
|
||||
if len + 4 > printer.size.x {
|
||||
return;
|
||||
}
|
||||
let x = match self.title_position {
|
||||
HAlign::Left => 3,
|
||||
HAlign::Center => (printer.size.x - len) / 2,
|
||||
HAlign::Right => printer.size.x - len - 3,
|
||||
};
|
||||
let spacing = 3; //minimum distance to borders
|
||||
let x = spacing + self.title_position.get_offset(len, printer.size.x - 2 * spacing);
|
||||
printer.with_high_border(false, |printer| {
|
||||
printer.print((x - 2, 0), "┤ ");
|
||||
printer.print((x + len, 0), " ├");
|
||||
|
Loading…
Reference in New Issue
Block a user