[DEV] try to correct the expand error... (START)
This commit is contained in:
parent
44749e4a6f
commit
46699c20b6
@ -69,6 +69,13 @@ void ewol::widget::Button::calculateSize(const vec2& _availlable) {
|
|||||||
//EWOL_DEBUG(" configuring : origin=" << origin << " size=" << subElementSize << "");
|
//EWOL_DEBUG(" configuring : origin=" << origin << " size=" << subElementSize << "");
|
||||||
m_selectableAreaPos = vec2(ret.xLeft(), ret.yButtom());
|
m_selectableAreaPos = vec2(ret.xLeft(), ret.yButtom());
|
||||||
m_selectableAreaSize = m_size - (m_selectableAreaPos + vec2(ret.xRight(), ret.yTop()));
|
m_selectableAreaSize = m_size - (m_selectableAreaPos + vec2(ret.xRight(), ret.yTop()));
|
||||||
|
|
||||||
|
if (m_userExpand->x() == true) {
|
||||||
|
m_size.setX(std::max(m_size.x(), _availlable.x()));
|
||||||
|
}
|
||||||
|
if (m_userExpand->y() == true) {
|
||||||
|
m_size.setY(std::max(m_size.y(), _availlable.y()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,7 +86,22 @@ void ewol::widget::Sizer::calculateSize(const vec2& _availlable) {
|
|||||||
// Now update his size his size in X and the curent sizer size in Y:
|
// Now update his size his size in X and the curent sizer size in Y:
|
||||||
if (m_mode == ewol::widget::Sizer::modeVert) {
|
if (m_mode == ewol::widget::Sizer::modeVert) {
|
||||||
if (it->canExpand().y() == true) {
|
if (it->canExpand().y() == true) {
|
||||||
it->calculateSize(vec2ClipInt32(vec2(m_size.x(), tmpSize.y()+sizeToAddAtEveryOne)));
|
vec2 expectedSize = vec2ClipInt32(vec2(m_size.x(), tmpSize.y()+sizeToAddAtEveryOne));
|
||||||
|
it->calculateSize(expectedSize);
|
||||||
|
vec2 underSize = it->getSize();
|
||||||
|
if (it->canExpand().x() == true) {
|
||||||
|
if (underSize.x() < expectedSize.x()) {
|
||||||
|
EWOL_WARNING("Subwidget request exapnd and does not expand ... ==> rules impose it ...");
|
||||||
|
//it->setSize(vec2(expectedSize.x(), underSize.y());
|
||||||
|
//underSize = it->getSize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (it->canExpand().y() == true) {
|
||||||
|
if (underSize.y() < expectedSize.y()) {
|
||||||
|
EWOL_WARNING("Subwidget request exapnd and does not expand ... ==> rules impose it ...");
|
||||||
|
//it->setSize(vec2(underSize.y(), expectedSize.x());
|
||||||
|
}
|
||||||
|
}
|
||||||
tmpOrigin.setY(tmpOrigin.y() + tmpSize.y()+sizeToAddAtEveryOne);
|
tmpOrigin.setY(tmpOrigin.y() + tmpSize.y()+sizeToAddAtEveryOne);
|
||||||
} else {
|
} else {
|
||||||
it->calculateSize(vec2ClipInt32(vec2(m_size.x(), tmpSize.y())));
|
it->calculateSize(vec2ClipInt32(vec2(m_size.x(), tmpSize.y())));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user