r-neal-kelly / the_scriptures

A Scriptural Study Suite
https://r-neal-kelly.github.io/the_scriptures/
Other
0 stars 0 forks source link

Efficient Rendering of Text Parts #1

Open r-neal-kelly opened 8 months ago

r-neal-kelly commented 8 months ago

So we do have the best that we can get for actually rendering out all the parts of the text and using buffers, etc. But it would be quicker to just render out the particular line that a user will click on, and just match up the coords. So we would have an off-screen element with the rendered parts, find the coords, normalize them to the browser, and then we can go from there. We'd know the part and where to activate pop-ups/whatever at that point.

It's not like the current code is a waste, as we'd need to be able to do this quickly on the fly like we are anyway, but in much smaller and less frequent chunks.

I don't think we should completely get rid of this mode, because we may need it for something unforseen in the future. Similar to how the search buffer works, it may be necessary to interact with multiple parts in a static way on the screen at one time, independent from the user's actions.

However for the main browser/text buffer, it would probably be just fine to do the efficiency trick.

r-neal-kelly commented 6 months ago

It's a lot of extra code to get it working though. Probably worth it, but right now decompression of LZSS compressed texts are probably a bigger bottleneck!