- if (cursor_visible) hideCursor();
-
- int const old_first = text->first_y;
- bool internal = (text == bv->text);
- text->first_y = y;
-
- // is any optimiziation possible?
- if ((y - old_first) < owner.workHeight()
- && (old_first - y) < owner.workHeight())
- {
- if (text->first_y < old_first) {
- drawFromTo(text, bv, 0,
- old_first - text->first_y, 0, 0, internal);
- XCopyArea (fl_get_display(),
- owner.getWin(),
- owner.getWin(),
- gc_copy,
- owner.xpos(),
- owner.ypos(),
- owner.workWidth(),
- owner.workHeight() - old_first + text->first_y,
- owner.xpos(),
- owner.ypos() + old_first - text->first_y
- );
- // expose the area drawn
- expose(0, 0,
- owner.workWidth(),
- old_first - text->first_y);
- } else {
- drawFromTo(text, bv,
- owner.workHeight() + old_first - text->first_y,
- owner.workHeight(), 0, 0, internal);
- XCopyArea (fl_get_display(),
- owner.getWin(),
- owner.getWin(),
- gc_copy,
- owner.xpos(),
- owner.ypos() + text->first_y - old_first,
- owner.workWidth(),
- owner.workHeight() + old_first - text->first_y,
- owner.xpos(),
- owner.ypos());
- // expose the area drawn
- expose(0, owner.workHeight() + old_first - text->first_y,
- owner.workWidth(), text->first_y - old_first);
- }
- } else {
- // make a dumb new-draw
- drawFromTo(text, bv, 0, owner.workHeight(), 0, 0, internal);
- expose(0, 0, owner.workWidth(), owner.workHeight());