randi120 / freetype-gl

Automatically exported from code.google.com/p/freetype-gl
Other
0 stars 0 forks source link

Unnecessary conditional #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The conditional check at [1] will always be false. The variable `i` is 
initialized to 0 at [2] and after that, never changed. This means that the 
`kerning` value will also always be 0.

[1]: 
http://code.google.com/p/freetype-gl/source/browse/branches/gl-3.0/text-buffer.c
#250
[2]: 
http://code.google.com/p/freetype-gl/source/browse/branches/gl-3.0/text-buffer.c
#205

Original issue reported on code.google.com by jimteeu...@gmail.com on 20 Oct 2012 at 12:19

GoogleCodeExporter commented 8 years ago
I am unsure what kind of consequences this has (kerning always being 0).
It is used in rendering background, overline, underline and strike-through, but 
not to render the glyphs themselves.

Original comment by jimteeu...@gmail.com on 20 Oct 2012 at 9:39

GoogleCodeExporter commented 8 years ago
Thanks It has been fixed.

text_add_wchar is called from 
http://code.google.com/p/freetype-gl/source/browse/branches/gl-3.0/text-buffer.c
#189 withe previous=0. The test for kerning should be against previous, not i 
as you found out.

Original comment by Nicolas.Rougier@gmail.com on 21 Oct 2012 at 7:42