From e62a54ee0bdf88aa5c42b71790d58b95e6203b99 Mon Sep 17 00:00:00 2001 From: joshhuelsman Date: Fri, 30 Jan 2015 18:58:59 -0500 Subject: [PATCH] stbte: fix number rendering when no layernames set --- stb_tilemap_editor.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/stb_tilemap_editor.h b/stb_tilemap_editor.h index ade6783..ac9eaf2 100644 --- a/stb_tilemap_editor.h +++ b/stb_tilemap_editor.h @@ -3394,9 +3394,14 @@ static void stbte__layers(stbte_tilemap *tm, int x0, int y0, int w, int h) int i, y, n; int x1 = x0+w; int y1 = y0+h; - int side = stbte__ui.panel[STBTE__panel_layers].side; - int xoff = tm->has_layer_names ? stbte__region[side].width - 42 : 20; - xoff = (xoff < tm->layername_width + 10 ? xoff : tm->layername_width + 10); + int xoff = 20; + + if (tm->has_layer_names) { + int side = stbte__ui.panel[STBTE__panel_layers].side; + xoff = tm->has_layer_names ? stbte__region[side].width - 42 : 20; + xoff = (xoff < tm->layername_width + 10 ? xoff : tm->layername_width + 10); + } + static char *propmodes[3] = { "default", "always", "never" };