[DEV] correct the scrolling and remove display of hiden element in the list

This commit is contained in:
Edouard DUPIN 2018-08-18 08:49:29 +02:00
parent dd373e1d2d
commit 84769bc26e

View File

@ -188,30 +188,27 @@ void ewol::widget::List::onRegenerateDisplay() {
// ------------------------------------------------------- // -------------------------------------------------------
for (int_t yyy=0; yyy<matrixSize.y(); ++yyy) { for (int_t yyy=0; yyy<matrixSize.y(); ++yyy) {
float startYposition = m_size.y() + m_originScrooled.y() - listStartPosY[yyy]; float startYposition = m_size.y() + m_originScrooled.y() - listStartPosY[yyy];
/*
if (startYposition + m_listSizeY[yyy] < 0) { if (startYposition + m_listSizeY[yyy] < 0) {
// ==> element out of range ==> nothing to display
continue;
}
if (startYposition > m_size.y()) {
// ==> element out of range ==> nothing to display // ==> element out of range ==> nothing to display
break; break;
} }
*/ if (startYposition > m_size.y()) {
// ==> element out of range ==> nothing to display
continue;
}
for (int_t xxx=0; xxx<matrixSize.x(); ++xxx) { for (int_t xxx=0; xxx<matrixSize.x(); ++xxx) {
float startXposition = m_originScrooled.x() + listStartPosX[xxx]; float startXposition = -m_originScrooled.x() + listStartPosX[xxx];
/* //EWOL_ERROR("display start: " << startXposition);
if (startYposition + m_listSizeX[xxx] < 0) { if (startXposition + m_listSizeX[xxx] < 0) {
// ==> element out of range ==> nothing to display // ==> element out of range ==> nothing to display
continue; continue;
} }
if (startYposition > m_size.x()) { if (startXposition > m_size.x()) {
// ==> element out of range ==> nothing to display // ==> element out of range ==> nothing to display
break; break;
} }
*/
drawElement(ivec2(xxx, yyy), drawElement(ivec2(xxx, yyy),
vec2(m_paddingSizeX + listStartPosX[xxx], startYposition), vec2(startXposition, startYposition),
vec2(m_listSizeX[xxx], m_listSizeY[yyy])); vec2(m_listSizeX[xxx], m_listSizeY[yyy]));
} }
} }