fix place 2 issues
calc dockable field size with wrong size for the percentage weight crash when access a non-existing dockable field
This commit is contained in:
parent
1326bae10f
commit
65f5d5f494
@ -1939,7 +1939,7 @@ namespace nana
|
||||
double weight;
|
||||
if (child->weight.is_not_none())
|
||||
{
|
||||
weight = child->weight.get_value(is_vert ? area.height : area.width);
|
||||
weight = child->weight.get_value(is_vert ? room.height : room.width);
|
||||
if (weight > room_px)
|
||||
weight = room_px;
|
||||
}
|
||||
@ -2800,7 +2800,7 @@ namespace nana
|
||||
}
|
||||
|
||||
//Create the pane if it has not a name
|
||||
if (factory_name.empty())
|
||||
if (factory_name.empty() && dock_ptr->attached)
|
||||
{
|
||||
dock_ptr->attached->set_display(true);
|
||||
impl_->collocate();
|
||||
@ -2825,6 +2825,8 @@ namespace nana
|
||||
throw std::invalid_argument("invalid factory name(" + factory + ") of dockpane");
|
||||
|
||||
auto dock_ptr = i->second;
|
||||
if (dock_ptr->attached)
|
||||
{
|
||||
dock_ptr->attached->set_display(true);
|
||||
impl_->collocate();
|
||||
|
||||
@ -2837,6 +2839,7 @@ namespace nana
|
||||
}
|
||||
|
||||
dock_ptr->dockarea->add_pane(i->second->factories[factory]);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user