]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
Various small fixes
[lyx.git] / src / text.C
index d915aac7280447325cb8f12ab8e540039e70dcc8..e0c054484d3cd4888e8935dc90285b3d4891aa73 100644 (file)
@@ -504,10 +504,12 @@ void LyXText::draw(BufferView * bview, Row const * row,
 //                     tmpinset->update(bview, font, false);
                        tmpinset->draw(bview, font, offset+row->baseline(), x,
                                       cleared);
+#ifdef SEEMS_TO_BE_NOT_NEEDED
                        if (status == CHANGED_IN_DRAW) {
                                UpdateInset(bview, tmpinset);
                                status = CHANGED_IN_DRAW;
                        }
+#endif
                }
                ++vpos;
 
@@ -3077,10 +3079,18 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
        } else if (clear_area) {
 #ifdef WITH_WARNINGS
 #warning Should be fixed with a lyxinset::clear_width(bv, font) function! (Jug)
+#warning Should we not fix this in the Painter, please have a look Lars! (Jug)
 #endif
-               int const w = (inset_owner ?
-                              inset_owner->width(bview, font)-2 : ww);
-               pain.fillRectangle(x_offset, y_offset, w, row_ptr->height());
+               int w = (inset_owner ? inset_owner->width(bview, font)-2 : ww);
+               int h = row_ptr->height();
+               int x = x_offset;
+               int y = y_offset;
+               if (y < 0) {
+                   h += y;
+                   y = 0;
+               }
+
+               pain.fillRectangle(x, y, w, h);
        } else if (inset != 0) {
                int h = row_ptr->baseline() - inset->ascent(bview, font);
                if (h > 0) {
@@ -3391,7 +3401,7 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
 
                for (int i = 1; i <= depth; ++i) {
                        int const line_x = (LYX_PAPER_MARGIN / 5) *
-                               (i + minipage) + box_x;
+                               (i + minipage) + box_x + x_offset;
                        pain.line(line_x, y_offset, line_x,
                                  y_offset + row_ptr->height() - 1 - (i - next_depth - 1) * 3,
                                  LColor::depthbar);