I think your example is ok
My guess is that with RenderSize it's sizing it to 0 because the images haven't loaded yet. Best option (for performance) is to set the img size via attributes or CSS. Or to have an onload callback for the image that will call fview.updateSize()
(a little tedious). I plan to add back in the watchSize
facility we had in v0, but if you manually specify the image size that really is the best way (even if you weren't using Famous). So what I would do is:
If all the tiles are the same size, give the img
tag a CSS class and set the width and height on that... you could likewise use absolute sizing on the node.
If all the tiles are different sizes, I'd suggest (for performance; as I would even without famous), to include all the tile sizes in the database collection, and use this data for width
and height
attributes on the img element, and use a helper to pipe these into size
for Famous.
Note, RenderSize should work fine if the img is sized via CSS/attribute... it's just that it gets the size when the template is first built, before the browser has downloaded the image and knows it's size. And as mentioned, there is a way available (now) to resize it later, and another way coming that automates this for you (but is less performant).