fix documentlayout automatic sizing
This commit is contained in:
parent
59e8806c9e
commit
6dd0a1338f
1 changed files with 4 additions and 2 deletions
|
@ -9,7 +9,7 @@ void DocumentLayout::run() {
|
|||
if (!m_target)
|
||||
return;
|
||||
|
||||
Point bound { m_margin, m_margin };
|
||||
Point bound { m_margin + m_target->rect().max_geometry().width(), m_margin };
|
||||
Point current_position { m_margin, m_margin };
|
||||
double largest_height_so_far = -1.0;
|
||||
|
||||
|
@ -36,10 +36,12 @@ void DocumentLayout::run() {
|
|||
|
||||
if (!new_row_because_of_control_widget) {
|
||||
current_position.add(child->rect().width() + m_margin, 0);
|
||||
bound.add(child->rect().width() + m_margin, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* account for the first row */
|
||||
bound.add(0, largest_height_so_far);
|
||||
|
||||
m_target->rect().set_width(bound.x());
|
||||
m_target->rect().set_height(bound.y());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue