BoundingBox Trouble

1 view
Skip to first unread message

Hicks, Matt

unread,
Oct 11, 2010, 8:29:48 PM10/11/10
to sgin...@googlegroups.com
Hey guys,

This is perhaps more a question for Lex, but figured others might have an opinion to, so I thought I'd share. :)

I've got nearly everything done with text support now and the only glaringly missing feature right now is text selection via mouse. It looks like everything is ready for me to use except I've run into a little snag.  Text support horizontal and vertical alignment that causes the positioning to be shifted post matrix. What this means is that updating the bounding box makes mouse selection work fine as long as it's centered both vertically and horizontally, but if it's alignment any other way it is not properly detecting hits.  You can test this by uncommenting line 16 in TestText to do right alignment and then clicking.  The component registers clicks to the right of it and misses clicks that are on the left side of it.

My question is, how is the right way to support this?  These values are set into VBO data when the text and wrapping information is generated so they are explicitly defined to positions locally after the matrix is loaded.  Do we add an offset positioning in the bounding volume or is there a better way to go about it?

Any suggestions are welcome.

Hicks, Matt

unread,
Oct 12, 2010, 8:47:09 AM10/12/10
to sgin...@googlegroups.com
After further reflection I realize that I made a mistake in the way I wrote alignment support.  There is locational alignment on every component that updates the matrix, but that wasn't sufficient for text alignment as each line within the text needs to be aligned.  My mistake was to replicate locational alignment and text alignment within the text alignment support.  Presumably I should be able to make text alignment align within its local area and avoid any bounding box issues and also update locational alignment to get the result I want.
Reply all
Reply to author
Forward
0 new messages