Fixed redraw problem when resizing vertically and cursor inside a inset.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@987 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2000-08-25 11:50:32 +00:00
parent 17674b902d
commit d4cf7ae0fa
6 changed files with 22 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2000-08-25 Juergen Vigna <jug@sad.it>
* src/lyxscreen.h: add force_clear variable and fuction to force
a clear area when redrawing in LyXText.
* src/text.C (GetVisibleRow): look if the screen forces a redraw.
2000-08-25 Lars Gullik Bjønnes <larsbj@lyx.org> 2000-08-25 Lars Gullik Bjønnes <larsbj@lyx.org>
* some whitespace and comment changes. * some whitespace and comment changes.

View File

@ -146,5 +146,7 @@ private:
Painter painter_; Painter painter_;
/// ///
FL_OBJECT * figinset_canvas; FL_OBJECT * figinset_canvas;
/// if we call redraw with true needed for locking-insets
bool screen_cleared;
}; };
#endif #endif

View File

@ -5,7 +5,7 @@ show_outputview=true
show_treeview=true show_treeview=true
header_file=Untitled.h header_file=Untitled.h
cpp_file=Untitled.cpp cpp_file=Untitled.cpp
browser_file=file:/usr/doc/qt1x-devel-1.45/qimageio.html browser_file=file:/usr/doc/qt1x-devel-1.45/qlistbox.html
[formcopyright.C] [formcopyright.C]
install_location= install_location=
dist=true dist=true

View File

@ -84,6 +84,8 @@ public:
If text->status is LyXText::NEED_VERY_LITTLE_REFRESH, If text->status is LyXText::NEED_VERY_LITTLE_REFRESH,
we only update the current row. */ we only update the current row. */
void Update(LyXText *, int y_offset=0, int x_offset=0); void Update(LyXText *, int y_offset=0, int x_offset=0);
///
bool forceClear() const { return force_clear; }
/// ///
bool cursor_visible; bool cursor_visible;
@ -113,6 +115,8 @@ private:
int cursor_pixmap_h; int cursor_pixmap_h;
/// ///
GC gc_copy; GC gc_copy;
///
bool force_clear;
}; };
#endif #endif

View File

@ -47,7 +47,7 @@ GC createGC()
// Constructor // Constructor
LyXScreen::LyXScreen(WorkArea & o) //, LyXText * text_ptr) LyXScreen::LyXScreen(WorkArea & o) //, LyXText * text_ptr)
: owner(o) //, text(text_ptr) : owner(o), force_clear(true) //, text(text_ptr)
{ {
// the cursor isnt yet visible // the cursor isnt yet visible
cursor_visible = false; cursor_visible = false;
@ -108,7 +108,8 @@ void LyXScreen::DrawFromTo(LyXText * text, int y1, int y2, int y_offset, int x_o
y += row->height(); y += row->height();
row = row->next(); row = row->next();
} }
force_clear = false;
// maybe we have to clear the screen at the bottom // maybe we have to clear the screen at the bottom
if ((y < y2) && text->bv_owner) { if ((y < y2) && text->bv_owner) {
owner.getPainter().fillRectangle(0, y, owner.getPainter().fillRectangle(0, y,
@ -135,6 +136,7 @@ void LyXScreen::DrawOneRow(LyXText * text, Row * row, long y_text,
} while (text->status == LyXText::CHANGED_IN_DRAW); } while (text->status == LyXText::CHANGED_IN_DRAW);
text->status = st; text->status = st;
} }
force_clear = false;
} }

View File

@ -36,6 +36,7 @@
#include "tracer.h" #include "tracer.h"
#include "font.h" #include "font.h"
#include "encoding.h" #include "encoding.h"
#include "lyxscreen.h"
using std::max; using std::max;
using std::min; using std::min;
@ -3928,12 +3929,13 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
bool clear_area = true; bool clear_area = true;
Inset * inset = 0; Inset * inset = 0;
if ((last == row_ptr->pos()) && if (!bview->screen()->forceClear() && (last == row_ptr->pos()) &&
(row_ptr->par()->GetChar(row_ptr->pos()) == LyXParagraph::META_INSET) && (row_ptr->par()->GetChar(row_ptr->pos()) == LyXParagraph::META_INSET) &&
(inset = row_ptr->par()->GetInset(row_ptr->pos()))) { (inset = row_ptr->par()->GetInset(row_ptr->pos()))) {
clear_area = inset->doClearArea(); clear_area = inset->doClearArea();
} }
if (cleared) { // we don't need to clear it's already done!!! // we don't need to clear it's already done!!!
if (cleared) {
clear_area = true; clear_area = true;
} else if (clear_area) { } else if (clear_area) {
int w = (inset_owner ? inset_owner->width(bview, font) : ww); int w = (inset_owner ? inset_owner->width(bview, font) : ww);