Add an extra test for the size whether or not to allow multiple lines
(not too much tested yet).
This commit is contained in:
parent
a4cb3afe0e
commit
a663689b4c
1 changed files with 6 additions and 2 deletions
|
@ -243,13 +243,17 @@ tpoint tcontrol::get_best_text_size(const tpoint& minimum_size) const
|
|||
|
||||
// Try with the minimum wanted size.
|
||||
text.set_maximum_width(size.x);
|
||||
text.set_maximum_height(size.y);
|
||||
if(multiline_label_) {
|
||||
text.set_maximum_height(size.y);
|
||||
}
|
||||
|
||||
// If doesn't fit try the maximum.
|
||||
if(text.is_truncated()) {
|
||||
const tpoint maximum_size(config_->max_width, config_->max_height);
|
||||
text.set_maximum_width(maximum_size.x ? maximum_size.x - border.x : -1);
|
||||
text.set_maximum_height(maximum_size.y ? maximum_size.y - border.y : -1);
|
||||
if(multiline_label_) {
|
||||
text.set_maximum_height(maximum_size.y ? maximum_size.y - border.y : -1);
|
||||
}
|
||||
}
|
||||
|
||||
size = text.get_size() + border;
|
||||
|
|
Loading…
Add table
Reference in a new issue