diff --git a/src/widget/document.c b/src/widget/document.c index d6aec38..f71e1bc 100644 --- a/src/widget/document.c +++ b/src/widget/document.c @@ -59,6 +59,17 @@ static void draw(MwWidget handle) { MwFLFont font = NULL; MwPoint u_p, s_p, c_p; int u = 0, s = 0, c = 0; + int s_y = 0; + int s_h = MwGetInteger(handle, MwNheight); + MwWidget p = handle->parent; + + s_y = MwGetInteger(handle, MwNy); + while(p != NULL && p->widget_class != MwWindowClass) { + s_y += MwGetInteger(p, MwNy); + + p = p->parent; + } + s_y *= -1; u_p.x = s_p.x = c_p.x = 0; u_p.y = s_p.y = c_p.y = 0; @@ -80,6 +91,8 @@ static void draw(MwWidget handle) { p.x = l->x; p.y = l->y + MwTextHeight(handle, font, l->text) / 2; + if(p.y <= s_y || p.y >= s_y + s_h) break; + if(u || s || c) { MwPoint line[2]; int j;