Compare commits

...

3 Commits

Author SHA1 Message Date
NishiOwO
549d235893 better 2025-12-28 21:56:45 +09:00
NishiOwO
0daa527b1d fix 2025-12-28 18:03:37 +09:00
NishiOwO
0ca7f6ed8a dispatch children_update 2025-12-28 17:41:11 +09:00
3 changed files with 10 additions and 3 deletions

View File

@@ -261,6 +261,8 @@ void MwDestroyWidget(MwWidget handle) {
if(i == arrlen(handle->parent->destroy_queue)) {
arrput(handle->parent->destroy_queue, handle);
}
MwDispatch(handle->parent, children_update);
}
destroy_children(handle);
handle->destroyed = 1;

View File

@@ -47,6 +47,8 @@ static void layout(MwWidget handle) {
int s = MwGetInteger(handle->children[i], MwNfixedSize);
if(n == MwDEFAULT) n = 1;
if(handle->children[i]->destroyed) continue;
if(s != MwDEFAULT) {
sz -= s + Margin;
} else {
@@ -60,6 +62,8 @@ static void layout(MwWidget handle) {
int wsz;
if(n == MwDEFAULT) n = 1;
if(handle->children[i]->destroyed) continue;
if(s != MwDEFAULT) {
wsz = s;
} else {

View File

@@ -254,10 +254,11 @@ static void draw(MwWidget handle) {
for(j = 1; j >= 0; j--) {
MwLLColor cl = j == 1 ? shadow : text;
for(cy = 1; cy < h - 1; cy++) {
int c = (l_one - s_one) / 2 + s_one;
int h = s_one / 2;
int c = (l_one - h) / 2 + s_one;
int c1 = (c <= cy && cy <= (c + s_one)) ? 1 : 0;
int c2 = ((s_one + l_one + c) <= cy && cy <= (s_one + l_one + c + s_one)) ? 1 : 0;
int c1 = (c <= cy && cy <= (c + h)) ? 1 : 0;
int c2 = ((s_one + l_one + c) <= cy && cy <= (s_one + l_one + c + h)) ? 1 : 0;
if(c1 || c2) {
for(cx = x; cx < x + s_one; cx++) {