From f3ca0dd5ae37f53287f99e75b4dedce2ea74a99b Mon Sep 17 00:00:00 2001 From: kaesve Date: Wed, 6 Mar 2019 18:14:03 +0100 Subject: [PATCH] Remove redundant scale check in stbtt_GetGlyphSDF --- stb_truetype.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/stb_truetype.h b/stb_truetype.h index 767f005..4fa2a2d 100644 --- a/stb_truetype.h +++ b/stb_truetype.h @@ -46,6 +46,7 @@ // Rob Loach Cort Stratton // Kenney Phillis Jr. github:oyvindjam // Brian Costabile github:vassvik +// Ken Voskuil (kaesve) // // VERSION HISTORY // @@ -4389,12 +4390,7 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc int w,h; unsigned char *data; - // if one scale is 0, use same scale for both - if (scale_x == 0) scale_x = scale_y; - if (scale_y == 0) { - if (scale_x == 0) return NULL; // if both scales are 0, return NULL - scale_y = scale_x; - } + if (scale == 0) return NULL; stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale, scale, 0.0f,0.0f, &ix0,&iy0,&ix1,&iy1);