move
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit

This commit is contained in:
Nishi 2026-09-17 02:06:39 +09:00
commit ae2d859e63

View file

@ -474,6 +474,21 @@ static void add_clickable(MwDocument d, char* c_title, MwRect* clickable) {
arrput(d->clickables, c); arrput(d->clickables, c);
} }
static void mouse_move(MwWidget handle) {
char* event = in_hitbox(handle, &handle->mouse_point);
MwDocument d = handle->internal;
if(d->center_cursor && event == NULL) {
MwLLSetCursor(handle->lowlevel, &MwCursorDefault, &MwCursorDefaultMask);
d->center_cursor = 0;
} else if(!d->center_cursor && event != NULL) {
MwLLSetCursor(handle->lowlevel, &MwCursorCenter, &MwCursorCenterMask);
d->center_cursor = 1;
}
}
static void layout(MwWidget handle) { static void layout(MwWidget handle) {
MwDocument d = handle->internal; MwDocument d = handle->internal;
int w = MwGetInteger(handle, MwNwidth); int w = MwGetInteger(handle, MwNwidth);
@ -602,6 +617,7 @@ static void layout(MwWidget handle) {
arrfree(fontstack); arrfree(fontstack);
mouse_move(handle);
MwForceRender(handle); MwForceRender(handle);
} }
@ -629,21 +645,6 @@ static void prop_change(MwWidget handle, const char* key) {
} }
} }
static void mouse_move(MwWidget handle) {
char* event = in_hitbox(handle, &handle->mouse_point);
MwDocument d = handle->internal;
if(d->center_cursor && event == NULL) {
MwLLSetCursor(handle->lowlevel, &MwCursorDefault, &MwCursorDefaultMask);
d->center_cursor = 0;
} else if(!d->center_cursor && event != NULL) {
MwLLSetCursor(handle->lowlevel, &MwCursorCenter, &MwCursorCenterMask);
d->center_cursor = 1;
}
}
static void resize(MwWidget handle) { static void resize(MwWidget handle) {
layout(handle); layout(handle);
} }