increase grow/shrink distance limits

--automatic icon sizer is using a prediction
algorithm in order to decide to grow or not the
items size. There is a chance that the prediction
calculations are executed too early and as
such grow/shrink limits it is better to not
be to near to each other. That approach should
make the AutomaticItemSizer implementation a little
more robust.
pull/10/head
Michail Vourlakos 5 years ago
parent 2bd037f79a
commit 08be166ae3

@ -155,8 +155,12 @@ Item {
layoutsContainer.startLayout.width+layoutsContainer.mainLayout.width+layoutsContainer.endLayout.width : layoutsContainer.mainLayout.width layoutsContainer.startLayout.width+layoutsContainer.mainLayout.width+layoutsContainer.endLayout.width : layoutsContainer.mainLayout.width
} }
var toShrinkLimit = maxLength-((1+(root.zoomFactor-1))*(root.iconSize + lengthMargins)); var itemLength = root.iconSize + lengthMargins;
var toGrowLimit = maxLength-((1+(root.zoomFactor-1))*(root.iconSize + lengthMargins));
var toShrinkLimit = maxLength - (root.zoomFactor * itemLength);
//! to grow limit must be a little less than the shrink one in order to be more robust and
//! not create endless loops from early calculations
var toGrowLimit = maxLength - (1.2 * root.zoomFactor * itemLength);
//console.log("toShrinkLimit: "+ toShrinkLimit); //console.log("toShrinkLimit: "+ toShrinkLimit);
//console.log("toGrowLimit: "+ toGrowLimit); //console.log("toGrowLimit: "+ toGrowLimit);

Loading…
Cancel
Save