Change count logic to density logic#25
Conversation
|
hi @cyrilchapon , I understand and like this modification ... however, what if we didn't make it breaking/incompatible? if I'm not mistaken, this line; this.count = Math.ceil((this.resolution / BASE_RESOLUTION) * this.settings.density);could be changed to; this.count = Math.ceil(
typeof this.settings.density !== "undefined" ?
this.resolution / BASE_RESOLUTION * this.settings.density :
this.settings.count
);which would allow for anyone using |
|
Hey @simeydotme, This is not stupid at all; I'd slightly change it though, maybe making (and documenting) the opposite ( (the reason being simple : |
|
I wrote that quite late, but I think it is doing just as you propose; if density is undefined, then use count. but if density is defined; use density. and all the other code (default density, and document density) remains. so new users will be using density, and old users will have no problems. |
Hi,
Reading the warning about mobile performance; it came to me the idea that
countis practically a nonsense in a resizable environment.When implementing "snow" effect for example; what you want is a constant visual density, instead of a constant "number of flakes". Thus, I implemented a new
densitylogic. I defaulted this to keep the same count as of today on a classic fullscreen desktop container (1400 * 660).It will recalculate the
count, which is now dynamic based ondensityxresolution.It's also less dangerous on mobile; based on the naïve principle of "a larger screen resolution basically often mean a stronger GPU calculation capacities".
This is a breaking change, non backward compatible