[DEV] add debug

This commit is contained in:
Edouard DUPIN 2013-05-17 07:40:20 +02:00
parent 11515a82f5
commit 13802b799c
3 changed files with 10 additions and 8 deletions

View File

@ -133,6 +133,7 @@ void widget::Container::CalculateMinMaxSize(void)
vec2 min = m_subWidget->GetCalculateMinSize();
m_minSize.setMax(min);
}
EWOL_ERROR("[" << GetId() << "] Result min size : " << m_minSize);
}
void widget::Container::OnRegenerateDisplay(void)

View File

@ -38,31 +38,31 @@ void widget::PopUp::CalculateSize(const vec2& _availlable)
m_size = _availlable;
if (NULL != m_subWidget) {
vec2 subElementSize = m_minSize;
EWOL_DEBUG(" subElementSize : " << subElementSize);
EWOL_DEBUG("[" << GetId() << "] popUP: m_minSize : " << subElementSize);
vec2 subElementOrigin = m_origin + (m_size-m_minSize)/2.0f;
EWOL_DEBUG(" subElementOrigin : " << subElementOrigin);
EWOL_DEBUG("[" << GetId() << "] popUP: subElementOrigin : " << subElementOrigin);
vec2 subWidgetSize = m_subWidget->GetCalculateMinSize();
EWOL_DEBUG(" subWidgetSize : " << subWidgetSize);
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
if (true == m_subWidget->CanExpand().x()) {
subWidgetSize.setX(m_minSize.x());
}
if (true == m_subWidget->CanExpand().y()) {
subWidgetSize.setY(m_minSize.y());
}
EWOL_DEBUG(" subWidgetSize : " << subWidgetSize);
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
// limit the size of the element :
subWidgetSize.setMin(m_minSize);
EWOL_DEBUG(" subWidgetSize : " << subWidgetSize);
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
// posiition at a int32_t pos :
subWidgetSize = vec2ClipInt32(subWidgetSize);
EWOL_DEBUG(" subWidgetSize : " << subWidgetSize);
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
// set config to the Sub-widget
vec2 subWidgetOrigin = m_origin + (m_size-subWidgetSize)/2.0f;
EWOL_DEBUG(" subWidgetOrigin : " << subWidgetOrigin);
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetOrigin : " << subWidgetOrigin);
subWidgetOrigin = vec2ClipInt32(subWidgetOrigin);
EWOL_DEBUG(" subWidgetOrigin : " << subWidgetOrigin);
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetOrigin : " << subWidgetOrigin);
m_subWidget->SetOrigin(subWidgetOrigin);
m_subWidget->CalculateSize(subWidgetSize);

View File

@ -415,6 +415,7 @@ vec2 ewol::Widget::RelativePosition(const vec2& _pos)
void ewol::Widget::CalculateMinMaxSize(void)
{
m_minSize = m_userMinSize.GetPixel();
EWOL_ERROR("[" << GetId() << "] convert in min size : " << m_userMinSize << " out=" << m_minSize);
m_maxSize = m_userMaxSize.GetPixel();
MarkToRedraw();
}