HI all,
I´m playing around with the hypeDocument.cloneElement - extension. Works pretty fine for me, I can adress the clones, give them class names, change color etc. ... just one issue:
given:
an area represented by a square and a single bar (cloneOriginal)
my objective:
clone the bar n-times and distribute cloneOriginal in between the area evenly (as you see, it´s gonna be a bar chart... )
Distribution is done by calculating the gap between the bars.
... and it works NEARLY perfectly. But the distribution is not ABSOLUTELY exact. I guess, it´s a math calculating thing, since the gaps differ slightly in width...
Distribution is correct, if I use Math.round or Math.floor for calculating the gap, but then the bars don´t fit inside the area...
Any idea?
Best regards, Kalle
Distribution without using Math.floo or Math.round
Thanks a lot, Mark! Hmmm... not sure... did you only change the window.startLeft += flaecheWidth/ anzBalken - part? And there´s still a small gap at the right edge... it doesn´t fit exactly, does it?
you'll need decimal points for positions. this can not be done with style.left instead try transform.translateX .... a guess didn't have a closer look
... and i can remeber that @MaxZieb's documentLoader also enables real cloning ... so that the resulting element is a Hype-Element ... though at loadtime of the doc, not afterwards