[DEBUG correction of the half pixel display on the widget
This commit is contained in:
parent
81458d0523
commit
9b025cee66
2
external/etk
vendored
2
external/etk
vendored
@ -1 +1 @@
|
|||||||
Subproject commit b433625df8188ca5d27d5adb1eedbf42c4590744
|
Subproject commit a2c5f8ac4e73a0981316099b400ee0b627054cab
|
@ -199,8 +199,10 @@ void widget::ContextMenu::OnRegenerateDisplay(void)
|
|||||||
}
|
}
|
||||||
bool widget::ContextMenu::OnEventInput(const ewol::EventInput& _event)
|
bool widget::ContextMenu::OnEventInput(const ewol::EventInput& _event)
|
||||||
{
|
{
|
||||||
//EWOL_INFO("Event ouside the context menu");
|
|
||||||
if (_event.GetId() > 0) {
|
if (_event.GetId() > 0) {
|
||||||
|
if (NULL != widget::Container::GetWidgetAtPos(_event.GetPos())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if( _event.GetStatus() == ewol::keyEvent::statusDown
|
if( _event.GetStatus() == ewol::keyEvent::statusDown
|
||||||
|| _event.GetStatus() == ewol::keyEvent::statusMove
|
|| _event.GetStatus() == ewol::keyEvent::statusMove
|
||||||
|| _event.GetStatus() == ewol::keyEvent::statusSingle
|
|| _event.GetStatus() == ewol::keyEvent::statusSingle
|
||||||
|
@ -120,10 +120,11 @@ void widget::Menu::AddSpacer(void)
|
|||||||
void widget::Menu::OnReceiveMessage(const ewol::EMessage& _msg)
|
void widget::Menu::OnReceiveMessage(const ewol::EMessage& _msg)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
if (true == ewol::Sizer$::OnReceiveMessage(_msg) {
|
if (true == ewol::Sizer::OnReceiveMessage(_msg) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
EWOL_ERROR(" receive message : " << _msg);
|
||||||
if (_msg.GetMessage() == widget::Button::eventPressed) {
|
if (_msg.GetMessage() == widget::Button::eventPressed) {
|
||||||
for(int32_t iii=0; iii<m_listElement.Size(); iii++) {
|
for(int32_t iii=0; iii<m_listElement.Size(); iii++) {
|
||||||
if (_msg.GetCaller() == m_listElement[iii]->m_widgetPointer) {
|
if (_msg.GetCaller() == m_listElement[iii]->m_widgetPointer) {
|
||||||
@ -173,8 +174,8 @@ void widget::Menu::OnReceiveMessage(const ewol::EMessage& _msg)
|
|||||||
widget::Sizer * mySizer = NULL;
|
widget::Sizer * mySizer = NULL;
|
||||||
widget::Button * myButton = NULL;
|
widget::Button * myButton = NULL;
|
||||||
|
|
||||||
// TODO : Set a gird ...
|
|
||||||
mySizer = new widget::Sizer(widget::Sizer::modeVert);
|
mySizer = new widget::Sizer(widget::Sizer::modeVert);
|
||||||
|
if (NULL != mySizer) {
|
||||||
mySizer->LockExpand(vec2(true,true));
|
mySizer->LockExpand(vec2(true,true));
|
||||||
// set it in the pop-up-system :
|
// set it in the pop-up-system :
|
||||||
m_widgetContextMenu->SetSubWidget(mySizer);
|
m_widgetContextMenu->SetSubWidget(mySizer);
|
||||||
@ -209,6 +210,7 @@ void widget::Menu::OnReceiveMessage(const ewol::EMessage& _msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ewol::WindowsPopUpAdd(m_widgetContextMenu);
|
ewol::WindowsPopUpAdd(m_widgetContextMenu);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -279,24 +279,24 @@ void ewol::Widget::SystemDraw(const DrawProperty& _displayProp)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
glViewport( tmpSize.m_origin.x(),
|
glViewport( (int32_t)tmpSize.m_origin.x(),
|
||||||
tmpSize.m_origin.y(),
|
(int32_t)tmpSize.m_origin.y(),
|
||||||
tmpSize.m_size.x(),
|
(int32_t)tmpSize.m_size.x(),
|
||||||
tmpSize.m_size.y());
|
(int32_t)tmpSize.m_size.y());
|
||||||
// special case, when origin < display origin, we need to cut the display :
|
// special case, when origin < display origin, we need to cut the display :
|
||||||
ivec2 downOffset = m_origin - tmpSize.m_origin;
|
ivec2 downOffset = m_origin - tmpSize.m_origin;
|
||||||
downOffset.setMin(ivec2(0,0));
|
downOffset.setMin(ivec2(0,0));
|
||||||
|
|
||||||
mat4 tmpTranslate = etk::matTranslate(vec3(-tmpSize.m_size.x()/2+m_offset.x() + downOffset.x(),
|
mat4 tmpTranslate = etk::matTranslate(vec3ClipInt32(vec3(-tmpSize.m_size.x()/2+m_offset.x() + downOffset.x(),
|
||||||
-tmpSize.m_size.y()/2+m_offset.y() + downOffset.y(),
|
-tmpSize.m_size.y()/2+m_offset.y() + downOffset.y(),
|
||||||
-1.0f));
|
-1.0f)));
|
||||||
mat4 tmpScale = etk::matScale(vec3(m_zoom, m_zoom, 1.0f));
|
mat4 tmpScale = etk::matScale(vec3(m_zoom, m_zoom, 1.0f));
|
||||||
mat4 tmpProjection = etk::matOrtho(-tmpSize.m_size.x()/2,
|
mat4 tmpProjection = etk::matOrtho((int32_t)(-tmpSize.m_size.x())>>1,
|
||||||
tmpSize.m_size.x()/2,
|
(int32_t)( tmpSize.m_size.x())>>1,
|
||||||
-tmpSize.m_size.y()/2,
|
(int32_t)(-tmpSize.m_size.y())>>1,
|
||||||
tmpSize.m_size.y()/2,
|
(int32_t)( tmpSize.m_size.y())>>1,
|
||||||
-1,
|
(int32_t)(-1),
|
||||||
1);
|
(int32_t)( 1));
|
||||||
mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
|
mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
|
||||||
|
|
||||||
ewol::openGL::Push();
|
ewol::openGL::Push();
|
||||||
@ -307,8 +307,7 @@ void ewol::Widget::SystemDraw(const DrawProperty& _displayProp)
|
|||||||
|
|
||||||
#ifdef old_PLOP
|
#ifdef old_PLOP
|
||||||
if( (_displayProp.m_origin.x() > m_origin.x())
|
if( (_displayProp.m_origin.x() > m_origin.x())
|
||||||
|| (_displayProp.m_origin.x() + _displayewol::Widget::Prop.m_size.x() < m_size.x() + m_origin.x()) ) {
|
|| (_displayProp.m_origin.x() + _displayProp.m_size.x() < m_size.x() + m_origin.x()) ) {
|
||||||
EWOL_CRITICAL("plop");
|
|
||||||
// here we invert the reference of the standard OpenGl view because the reference in the common display is Top left and not buttom left
|
// here we invert the reference of the standard OpenGl view because the reference in the common display is Top left and not buttom left
|
||||||
int32_t tmpOriginX = etk_max(_displayProp.m_origin.x(), m_origin.x());
|
int32_t tmpOriginX = etk_max(_displayProp.m_origin.x(), m_origin.x());
|
||||||
int32_t tmppp1 = _displayProp.m_origin.x() + _displayProp.m_size.x();
|
int32_t tmppp1 = _displayProp.m_origin.x() + _displayProp.m_size.x();
|
||||||
@ -330,11 +329,8 @@ void ewol::Widget::SystemDraw(const DrawProperty& _displayProp)
|
|||||||
mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
|
mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
|
||||||
// set internal matrix system :
|
// set internal matrix system :
|
||||||
ewol::openGL::SetMatrix(tmpMat);
|
ewol::openGL::SetMatrix(tmpMat);
|
||||||
// Call the widget drawing methode
|
|
||||||
_displayProp.m_origin.setValue(tmpOriginX, tmpOriginY);
|
|
||||||
_displayProp.m_size.setValue(tmpclipX, m_size.y());
|
|
||||||
//int64_t ___startTime = ewol::GetTime();
|
//int64_t ___startTime = ewol::GetTime();
|
||||||
OnDraw(_displayProp);
|
OnDraw();
|
||||||
//float ___localTime = (float)(ewol::GetTime() - ___startTime) / 1000.0f;
|
//float ___localTime = (float)(ewol::GetTime() - ___startTime) / 1000.0f;
|
||||||
//EWOL_DEBUG(" Widget1 : " << ___localTime << "ms ");
|
//EWOL_DEBUG(" Widget1 : " << ___localTime << "ms ");
|
||||||
} else {
|
} else {
|
||||||
@ -349,11 +345,8 @@ void ewol::Widget::SystemDraw(const DrawProperty& _displayProp)
|
|||||||
mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
|
mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
|
||||||
// set internal matrix system :
|
// set internal matrix system :
|
||||||
ewol::openGL::SetMatrix(tmpMat);
|
ewol::openGL::SetMatrix(tmpMat);
|
||||||
// Call the widget drawing methode
|
|
||||||
_displayProp.m_origin = m_origin;
|
|
||||||
_displayProp.m_size = m_size;
|
|
||||||
//int64_t ___startTime = ewol::GetTime();
|
//int64_t ___startTime = ewol::GetTime();
|
||||||
OnDraw(_displayProp);
|
OnDraw();
|
||||||
//float ___localTime = (float)(ewol::GetTime() - ___startTime) / 1000.0f;
|
//float ___localTime = (float)(ewol::GetTime() - ___startTime) / 1000.0f;
|
||||||
//EWOL_DEBUG(" Widget2 : " << ___localTime << "ms ");
|
//EWOL_DEBUG(" Widget2 : " << ___localTime << "ms ");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user