small bug in textfield (19. pr10)?

  • Hi eveyrone!

    In one of our projects I use textfield as distorted hotspots placed here and there in the pano. However, I've just bumped into some strange issue. The last couple of words is cut from the textfield, BUT if I trace html of the hotspot, it's okay.

    Here's the link of what I mean:

    http://vt.most-inform.com/bugs/text/


    Krpano text is cut in the end but is okay if traced from the log.

    I tested latest Chrome, Firefox (Win 7) and Chrome (Android 6.0, Redmi note 4 phone). All is the same for me here.


    Klaus, are there any restrictions when using textfield as distorted spots?

    Regards,

    Alexey

  • Hi,

    an update to this - that's not directly a 'small' bug, it's more an 'incomplete' implementation *wink* of the text line-breaking algorithm.

    As written for the WebGL textfields internally almost everything needs to be done manually - the browser itself provides only the raw text and the bounding boxes of the lines. So to get the final text as bitmap for a WebGL texture, it's necessary to map/fit and render the text into these boxes. This is done by trying word by word if the current word would still fit into the current bounding box - and if not, begin filling the next box with words.

    And here was the incomplete implementation - the current algorithm was only considering white-space-characters as potential line-break possibilities, but there are also '-' characters within words where a line could break. Because this was missing the text rendering didn't match the bounding boxes anymore and the whole text gets wrong (resulting in something like 'cut of text' of other problems).

    For the next release this had been fixed now, there the line-breaking algorithm has been much improved and should now match 1:1 the html rendering in (hopefully) all cases.

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!