Sunday, April 1, 2012

Renderer Fixes and Positioning


Hi,

I looked through the renderer. The reason it was crashing was because someone passed in an incorrect URL as its final parameter. This caused an out-of-bounds error. I refactored that code so that that's outside of the renderer itself, so now it's more clear what's going on. The baseurl is a directory of the .CSS files. I don't know what that should be, because whatever it was before got changed.

Secondly, this fix automatically makes the renderer work again. However, it would still output nothing if nothing substantial is passed into it. This can happen, for example, after the renderer has already been called once (the canvases seem to get screwed up still). I can't say that was *entirely* not my fault, because half of the problem had to do with an undocumented bug in GWT, which in turn caused a problem in my code. Anyway, I fixed it, and the output corresponds to the input in all test cases I've tried.

However, someone changed the positioning to relative positioning, so the positioning-hack for superimposing the template and pages doesn't work anymore. I understood this was going to happen eventually, so it's not unexpected. I then figured out an algorithm to get relative positioning working. It's pretty simple, and I kept the old algorithm just in case. It correctly positions both the headers and footers. There's still a problem, though. The height of the template's footer is 34px. The height of other pages' footers is the default, 100px. I suspect this to be a bug somewhere else. Once this is fixed, I'll finish up the position algorithm by getting the footers' positioning working.

Thanks,
Ian

P.S.: The whole thing about the (de)serializer and renderer changing the editor afterwards? It turns out that new canvases don't go away unless you explicitly kill them with .destroy()--garbage collection evidently doesn't do anything. This was news to me, anyway. I haven't observed the problem with the (de)serializer, so perhaps Theo figured this out too. Anyway, I've also added fixes to the renderer to solve that as well.

No comments:

Post a Comment