@@ -33,12 +33,20 @@ cell_rep::typeset (tree fm, tree t, path iq) {
3333 cell_local_begin (fm);
3434 if (is_func (t, SUBTABLE , 1 )) {
3535 lsep= rsep= bsep= tsep= 0 ;
36- T = table (env, 2 );
36+ var->reset (CELL_LSEP );
37+ var->reset (CELL_RSEP );
38+ var->reset (CELL_BSEP );
39+ var->reset (CELL_TSEP );
40+ T= table (env, 2 );
3741 T->typeset_subtable (t[0 ], descend (iq, 0 ), var);
3842 }
3943 else if (is_func (t, DOCUMENT , 1 ) && is_func (t[0 ], SUBTABLE , 1 )) {
4044 lsep= rsep= bsep= tsep= 0 ;
41- T = table (env, 2 );
45+ var->reset (CELL_LSEP );
46+ var->reset (CELL_RSEP );
47+ var->reset (CELL_BSEP );
48+ var->reset (CELL_TSEP );
49+ T= table (env, 2 );
4250 T->typeset_subtable (t[0 ][0 ], descend (descend (iq, 0 ), 0 ), var);
4351 }
4452 else {
@@ -386,7 +394,7 @@ cell_rep::position_horizontally (SI offset, SI mw, SI lw, SI rw) {
386394 else xoff= lw;
387395 if (N (halign) > 1 ) xoff-= b->get_leaf_offset (halign (1 , N (halign)));
388396 }
389- else xoff= -T->x1 + lborder ;
397+ else xoff= -T->x1 ;
390398}
391399
392400void
@@ -404,7 +412,7 @@ cell_rep::position_vertically (SI offset, SI mh, SI bh, SI th) {
404412 else if (align_c == ' T' ) yoff= mh - th;
405413 else yoff= bh;
406414 }
407- else yoff= -T->y1 + bborder ;
415+ else yoff= -T->y1 ;
408416}
409417
410418/* *****************************************************************************
@@ -452,7 +460,13 @@ cell_rep::finish () {
452460 b= T->b ;
453461 }
454462
455- b= cell_box (ip, b, xoff, yoff, 0 , 0 , x2 - x1, y2 - y1, lborder, rborder,
456- bborder, tborder, dborder, aborder, env->pen ->get_brush (),
457- brush (bg, env->alpha ));
463+ if (!is_nil (T)) {
464+ b= cell_box (ip, b, xoff, yoff, 0 , 0 , x2 - x1, y2 - y1, 0 , 0 , 0 , 0 , 0 , 0 ,
465+ env->pen ->get_brush (), brush (bg, env->alpha ));
466+ }
467+ else {
468+ b= cell_box (ip, b, xoff, yoff, 0 , 0 , x2 - x1, y2 - y1, lborder, rborder,
469+ bborder, tborder, dborder, aborder, env->pen ->get_brush (),
470+ brush (bg, env->alpha ));
471+ }
458472}
0 commit comments