on xenial help sign in
Don't precache items that are outisde the 1.5*height buffering area
8060c39Albert Astals
qml/Dash/GenericScopeView.qml+11−7
@@ -401,6 +401,12 @@ FocusScope {
401 }
401 }
402
402
403 if (item && item.hasOwnProperty("displayMarginBeginning")) {
403 if (item && item.hasOwnProperty("displayMarginBeginning")) {
404+ var buffer = wasCurrentOnMoveStart ? categoryView.height * 1.5 : 0;
405+ var onViewport = baseItem.y + baseItem.height > 0 &&
406+ baseItem.y < categoryView.height;
407+ var onBufferViewport = baseItem.y + baseItem.height > -buffer &&
408+ baseItem.y < categoryView.height + buffer;
409+
404 if (item.growsVertically) {
410 if (item.growsVertically) {
405 // A item view creates its delegates synchronously from
411 // A item view creates its delegates synchronously from
406 // -displayMarginBeginning
412 // -displayMarginBeginning
@@ -428,7 +434,7 @@ FocusScope {
428 displayMarginEnd = -Math.min(-displayMarginEnd, baseItem.height);
434 displayMarginEnd = -Math.min(-displayMarginEnd, baseItem.height);
429 displayMarginEnd = Math.round(displayMarginEnd);
435 displayMarginEnd = Math.round(displayMarginEnd);
430
436
431− if (scopeView.isCurrent || scopeView.visibleToParent) {
437+ if (onBufferViewport && (scopeView.isCurrent || scopeView.visibleToParent)) {
432 item.displayMarginBeginning = displayMarginBeginning;
438 item.displayMarginBeginning = displayMarginBeginning;
433 item.displayMarginEnd = displayMarginEnd;
439 item.displayMarginEnd = displayMarginEnd;
434 if (holdingList && holdingList.moving) {
440 if (holdingList && holdingList.moving) {
@@ -441,7 +447,10 @@ FocusScope {
441 item.cacheBuffer = 0;
447 item.cacheBuffer = 0;
442 }
448 }
443 } else {
449 } else {
450+ // Protect us against cases where the item hasn't yet been positioned
451+ if (!(categoryView.contentY === 0 && baseItem.y === 0 && index !== 0)) {
444− item.cacheBuffer = categoryView.height * 1.5;
452+ item.cacheBuffer = categoryView.height * 1.5;
453+ }
445 }
454 }
446 } else {
455 } else {
447 var visibleRange = baseItem.height + displayMarginEnd + displayMarginBeginning;
456 var visibleRange = baseItem.height + displayMarginEnd + displayMarginBeginning;
@@ -459,11 +468,6 @@ FocusScope {
459 }
468 }
460 }
469 }
461 } else {
470 } else {
462− var buffer = wasCurrentOnMoveStart ? categoryView.height * 1.5 : 0;
463− var onViewport = baseItem.y + baseItem.height > 0 &&
464− baseItem.y < categoryView.height;
465− var onBufferViewport = baseItem.y + baseItem.height > -buffer &&
466− baseItem.y < categoryView.height + buffer;
467 if (!onBufferViewport) {
471 if (!onBufferViewport) {
468 // If not on the buffered viewport, don't load anything
472 // If not on the buffered viewport, don't load anything
469 item.displayMarginBeginning = 0;
473 item.displayMarginBeginning = 0;