comparison nuklear_ui/nuklear.h @ 2261:86dfcf3f418a

Fix crash at very low resolutions
author Michael Pavone <pavone@retrodev.com>
date Fri, 23 Dec 2022 05:49:04 -0800
parents 579fe3f6fe76
children
comparison
equal deleted inserted replaced
2260:3f155bc13183 2261:86dfcf3f418a
11385 } 11385 }
11386 11386
11387 *height = 0; 11387 *height = 0;
11388 int width_estimate = sqrt(pixel_area_estimate) + 0.5; 11388 int width_estimate = sqrt(pixel_area_estimate) + 0.5;
11389 *width = 128; 11389 *width = 128;
11390 while (*width < width_estimate) 11390 while (*width < width_estimate || *width < custom->w * 2)
11391 { 11391 {
11392 *width *= 2; 11392 *width *= 2;
11393 } 11393 }
11394 //*width = (total_glyph_count > 1000) ? 1024 : 512; 11394 //*width = (total_glyph_count > 1000) ? 1024 : 512;
11395 nk_tt_PackBegin(&baker->spc, 0, (int)*width, (int)max_height, 0, 1, alloc); 11395 nk_tt_PackBegin(&baker->spc, 0, (int)*width, (int)max_height, 0, 1, alloc);