|
@@ -4742,6 +4742,8 @@ static void layout_block(struct lay *l, unsigned int node,
|
|
|
int definite_w = 0;
|
|
int definite_w = 0;
|
|
|
int normal_top = 0;
|
|
int normal_top = 0;
|
|
|
int rel_dx = 0, rel_dy = 0;
|
|
int rel_dx = 0, rel_dy = 0;
|
|
|
|
|
+ int clip_pushed = 0;
|
|
|
|
|
+ struct ngui_rect clip_rect;
|
|
|
|
|
|
|
|
if (depth > 24 || st->display == BR_DISPLAY_NONE)
|
|
if (depth > 24 || st->display == BR_DISPLAY_NONE)
|
|
|
return;
|
|
return;
|
|
@@ -4980,6 +4982,17 @@ static void layout_block(struct lay *l, unsigned int node,
|
|
|
draw_border_box(l->ui, box, st);
|
|
draw_border_box(l->ui, box, st);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if (l->draw && st->overflow_hidden && block_h[node] > 0 &&
|
|
|
|
|
+ l->ui && l->ui->nclip < 4) {
|
|
|
|
|
+ clip_rect.x = l0 + bl;
|
|
|
|
|
+ clip_rect.y = top + bt;
|
|
|
|
|
+ clip_rect.w = (r0 - l0) - bl - br;
|
|
|
|
|
+ clip_rect.h = (int)block_h[node] - bt - bb;
|
|
|
|
|
+ if (clip_rect.w > 0 && clip_rect.h > 0) {
|
|
|
|
|
+ ngui_push_clip(l->ui, clip_rect);
|
|
|
|
|
+ clip_pushed = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
l->left = l0 + bl + pl;
|
|
l->left = l0 + bl + pl;
|
|
|
l->right = l->left + content_w;
|
|
l->right = l->left + content_w;
|
|
|
if (l->right < l->left + 8)
|
|
if (l->right < l->left + 8)
|
|
@@ -5080,6 +5093,8 @@ static void layout_block(struct lay *l, unsigned int node,
|
|
|
layout_children(l, node, st, depth + 1, link);
|
|
layout_children(l, node, st, depth + 1, link);
|
|
|
}
|
|
}
|
|
|
flush_line(l);
|
|
flush_line(l);
|
|
|
|
|
+ if (clip_pushed)
|
|
|
|
|
+ ngui_pop_clip(l->ui);
|
|
|
if (l->float_active) {
|
|
if (l->float_active) {
|
|
|
if (l->y < l->float_bottom)
|
|
if (l->y < l->float_bottom)
|
|
|
l->y = l->float_bottom;
|
|
l->y = l->float_bottom;
|
|
@@ -6697,8 +6712,28 @@ static void layout_children(struct lay *l, unsigned int parent,
|
|
|
}
|
|
}
|
|
|
if (nd->tag == BR_TAG_A && nd->href_off)
|
|
if (nd->tag == BR_TAG_A && nd->href_off)
|
|
|
lk = (unsigned short)n;
|
|
lk = (unsigned short)n;
|
|
|
- if (cs.pos == 1 || cs.pos == 2) {
|
|
|
|
|
- if (l->draw && ndeferred < 16) {
|
|
|
|
|
|
|
+ if (cs.pos == 1 || cs.pos == 2 ||
|
|
|
|
|
+ (cs.pos == 3 && cs.z_set)) {
|
|
|
|
|
+ if (cs.pos == 3 && l->draw && ndeferred < 16) {
|
|
|
|
|
+ /* Relative z-index: measure and advance the flow
|
|
|
|
|
+ * without painting, then paint it in the
|
|
|
|
|
+ * deferred (stacked) pass. */
|
|
|
|
|
+ int fy = l->y, fl = l->left, fr = l->right;
|
|
|
|
|
+ int save_draw = l->draw;
|
|
|
|
|
+
|
|
|
|
|
+ l->draw = 0;
|
|
|
|
|
+ layout_block(l, n, &cs, depth + 1, lk);
|
|
|
|
|
+ l->draw = save_draw;
|
|
|
|
|
+ deferred[ndeferred].node = n;
|
|
|
|
|
+ deferred[ndeferred].flow_y = fy;
|
|
|
|
|
+ deferred[ndeferred].flow_left = fl;
|
|
|
|
|
+ deferred[ndeferred].flow_right = fr;
|
|
|
|
|
+ deferred[ndeferred].link = lk;
|
|
|
|
|
+ deferred[ndeferred].z_index = cs.z_index;
|
|
|
|
|
+ deferred[ndeferred].z_set = cs.z_set;
|
|
|
|
|
+ deferred[ndeferred].order = (unsigned int)ndeferred;
|
|
|
|
|
+ ndeferred++;
|
|
|
|
|
+ } else if (l->draw && ndeferred < 16) {
|
|
|
deferred[ndeferred].node = n;
|
|
deferred[ndeferred].node = n;
|
|
|
deferred[ndeferred].flow_y = l->y;
|
|
deferred[ndeferred].flow_y = l->y;
|
|
|
deferred[ndeferred].flow_left = l->left;
|
|
deferred[ndeferred].flow_left = l->left;
|