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