idk how this works, but seems to work
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
8870b3a0c5
commit
ece1527689
2 changed files with 7 additions and 8 deletions
|
|
@ -10,8 +10,8 @@ static void resize(MwWidget handle, void* user, void* call) {
|
|||
(void)call;
|
||||
|
||||
MwVaApply(vp,
|
||||
MwNwidth, w - 10,
|
||||
MwNheight, h - 10,
|
||||
MwNwidth, w - 10 - 100,
|
||||
MwNheight, h - 10 - 100,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ int main() {
|
|||
|
||||
w = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480, MwNtitle, "test", NULL);
|
||||
|
||||
vp = MwCreateWidget(MwViewportClass, "vp", w, 5, 5, 630, 470);
|
||||
vp = MwCreateWidget(MwViewportClass, "vp", w, 5 + 100, 5 + 100, 640 - 10 - 100, 480 - 10 - 100);
|
||||
|
||||
px = MwLoadImage(vp, "examples/picture.png");
|
||||
|
||||
|
|
|
|||
|
|
@ -1741,18 +1741,17 @@ static void clip(MwLL handle) {
|
|||
y = 0;
|
||||
cx = 0;
|
||||
cy = 0;
|
||||
// # ws is traversed result
|
||||
// # ws[ws.length - 1] is ignored bc it's toplevel
|
||||
// ws is traversed result
|
||||
// ws[ws.length - 1] is ignored bc it's toplevel
|
||||
for(i = arrlen(ws) - 2; i >= 0; i--) {
|
||||
x += ws[i]->wayland.x;
|
||||
y += ws[i]->wayland.y;
|
||||
cx += MAX(-ws[i]->wayland.x, 0);
|
||||
cy += MAX(-ws[i]->wayland.y, 0);
|
||||
w = MIN(ws[i]->wayland.ww - MAX(-x, 0), w);
|
||||
h = MIN(ws[i]->wayland.wh - MAX(-y, 0), h);
|
||||
}
|
||||
|
||||
cx = MAX(-x, 0);
|
||||
cy = MAX(-y, 0);
|
||||
|
||||
arrfree(ws);
|
||||
|
||||
handle->wayland.clipping_rect.x = cx;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue