From 3f9a5bebe6a824c74a6b51846e0d36513de2596e Mon Sep 17 00:00:00 2001 From: sa Date: Sat, 19 Sep 2015 16:41:49 -0400 Subject: [PATCH] Fix undersized glyph bounding boxes for click support The removed line of code doesn't actually prevent unclickable dead zones, but it DOES sometimes lead to the generated per-glyph bounding boxes used for click support to be too small (the demo's Arial letter 'j' is a good example.) This should alleviate the problem discussed in #11. --- Typogenic/Scripts/TypogenicText.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Typogenic/Scripts/TypogenicText.cs b/Typogenic/Scripts/TypogenicText.cs index 0eeb25d..a1e26fd 100644 --- a/Typogenic/Scripts/TypogenicText.cs +++ b/Typogenic/Scripts/TypogenicText.cs @@ -387,11 +387,7 @@ float BlitString(string str, float cursorX, float cursorY, List vertexPoint // Only need to store glyph bounds if click support is enabled. if (EnableClickSupport) { - - // Click bounds for glyphs are based on allocated space, not rendered space. - // Otherwise we'll end up with unclickable dead zones between glyphs. - r.width = glyph.xAdvance * Size; - // And Y coordinates are just not handled the same at all. + // Y coordinates are just not handled the same at all. r.y = -cursorY - r.height - glyph.yOffset * Size;