fix stuff
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-04-27 04:25:16 +09:00
commit 212d00ea13
Signed by: nishi
GPG key ID: 27EF69B208EB9343
3 changed files with 23 additions and 8 deletions

View file

@ -199,16 +199,24 @@ static void frame_draw(MwWidget handle) {
str = MwStringDuplicate(t);
if(MwUTF8Length(str) > (get_col_width(lb, j) - l) / MwTextWidth(handle, Font, "M")) {
int ind = (get_col_width(lb, j) - l) / MwTextWidth(handle, Font, "M") - 3;
int seek = 0;
int l = 0;
int ind = (get_col_width(lb, j) - l) / MwTextWidth(handle, Font, "M") - 3;
int seek = 0;
int l = 0;
char* old = str;
if(ind < 0) ind = 0;
str = malloc(strlen(old) + 5);
strcpy(str, old);
free(old);
while(str[seek] != 0) {
int cp;
if(l == ind) break;
seek += MwUTF8ToUTF32(str + seek, &cp);
l++;
if(l == ind) break;
}
memset(str + seek, '.', 3);