fix DocumentLayout
This commit is contained in:
parent
23bde79967
commit
cd38bad6ea
1 changed files with 5 additions and 2 deletions
|
@ -21,7 +21,7 @@ void DocumentLayout::run() {
|
||||||
largest_height_so_far = child->rect().height();
|
largest_height_so_far = child->rect().height();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool new_row_because_of_control_widget = (child->control_type() == ControlWidgetType::NewRow && largest_height_so_far);
|
bool new_row_because_of_control_widget = (child->control_type() == ControlWidgetType::NewRow);
|
||||||
bool new_row_because_of_justification = (current_position.x() + child->rect().width() + m_margin) >= m_target->rect().width();
|
bool new_row_because_of_justification = (current_position.x() + child->rect().width() + m_margin) >= m_target->rect().width();
|
||||||
bool should_do_new_row = new_row_because_of_control_widget || new_row_because_of_justification;
|
bool should_do_new_row = new_row_because_of_control_widget || new_row_because_of_justification;
|
||||||
if (should_do_new_row) {
|
if (should_do_new_row) {
|
||||||
|
@ -31,8 +31,11 @@ void DocumentLayout::run() {
|
||||||
|
|
||||||
child->rect().set_x(current_position.x());
|
child->rect().set_x(current_position.x());
|
||||||
child->rect().set_y(current_position.y());
|
child->rect().set_y(current_position.y());
|
||||||
|
|
||||||
|
if (!new_row_because_of_control_widget) {
|
||||||
current_position.add(child->rect().width() + m_margin, 0);
|
current_position.add(child->rect().width() + m_margin, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue