From 5c482f9d9b357e098f955351f425bc985254ff28 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 18 Mar 2023 17:33:27 +0100 Subject: Fix and update alignment #346 (#701) * interactive layout alignment rewritten * interface for new alignment rules * new alignment dialog box * user defined layout rules added * layout rules can be stored in projects, settings, and external files * Valgrind verification --- src/fl_draw.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/fl_draw.cxx') diff --git a/src/fl_draw.cxx b/src/fl_draw.cxx index 04ebbc6e0..5073d4ee4 100644 --- a/src/fl_draw.cxx +++ b/src/fl_draw.cxx @@ -43,15 +43,17 @@ static char* underline_at; */ static const char* expand_text_(const char* from, char*& buf, int maxbuf, double maxw, int& n, double &width, int wrap, int draw_symbols) { - char* e = buf+(maxbuf-4); underline_at = 0; double w = 0; static int l_local_buff = 500; static char *local_buf = (char*)malloc(l_local_buff); // initial buffer allocation + char* e; if (maxbuf == 0) { buf = local_buf; e = buf + l_local_buff - 4; - } + } else { + e = buf+(maxbuf-4); + } char* o = buf; char* word_end = o; const char* word_start = from; -- cgit v1.2.3