Jelajahi Sumber

Fixed #375 long window title drawing bug

vurtun 8 tahun lalu
induk
melakukan
a979372909
2 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 1 0
      CHANGELOG.md
  2. 2 1
      nuklear.h

+ 1 - 0
CHANGELOG.md

@@ -11,6 +11,7 @@
 
 
 Changes:
 Changes:
 --------
 --------
+- 2017/03/18 (1.34.3) - Fixed long window header titles
 - 2017/03/04 (1.34.2) - Fixed text edit filtering
 - 2017/03/04 (1.34.2) - Fixed text edit filtering
 - 2017/03/04 (1.34.1) - Fixed group closable flag
 - 2017/03/04 (1.34.1) - Fixed group closable flag
 - 2017/02/25 (1.34.0) - Added custom draw command for better language binding support
 - 2017/02/25 (1.34.0) - Added custom draw command for better language binding support

+ 2 - 1
nuklear.h

@@ -1,5 +1,5 @@
 /*
 /*
- Nuklear - 1.33.0 - public domain
+ Nuklear - 1.34.3 - public domain
  no warrenty implied; use at your own risk.
  no warrenty implied; use at your own risk.
  authored from 2015-2017 by Micha Mettke
  authored from 2015-2017 by Micha Mettke
 
 
@@ -16633,6 +16633,7 @@ nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type pan
         label.y = header.y + style->window.header.label_padding.y;
         label.y = header.y + style->window.header.label_padding.y;
         label.h = font->height + 2 * style->window.header.label_padding.y;
         label.h = font->height + 2 * style->window.header.label_padding.y;
         label.w = t + 2 * style->window.header.spacing.x;
         label.w = t + 2 * style->window.header.spacing.x;
+        label.w = NK_MIN(label.w, header.x + header.w - label.x);
         nk_widget_text(out, label,(const char*)title, text_len, &text, NK_TEXT_LEFT, font);}
         nk_widget_text(out, label,(const char*)title, text_len, &text, NK_TEXT_LEFT, font);}
     }
     }