* Copy/paste using middle mouse button inserts musical notes.
-* open a file; mark with the mouse and scroll; assert will fail:
-
- Row const & LyXText::getRowNearY(BufferView const & bv, int y, pit_type pit) const
- {
- Paragraph const & par = pars_[pit];
- int yy = bv.coordCache().get(this, pit).y_ - par.ascent();
- BOOST_ASSERT(!par.rows().empty());
- RowList::const_iterator rit = par.rows().begin();
- RowList::const_iterator const rlast = boost::prior(par.rows().end());
- for (; rit != rlast; yy += rit->height(), ++rit)
- if (yy + rit->height() > y)
- break;
- return *rit;
- }
-
* new document; insert note; place cursor in front of the note; activate change tracking;
press delete =>
PAINTING & PERFORMANCE
-* Selection highlighting is broken. Test case: two paragraphs with "Hello"
- and "World"; move cursor past "Wor", press Shift+Up
+* Too much painting 2 (Edwin 3/11/2006): There is also a lot of painting going
+ on when selecting text. When selecting a word the whole screen is repainted.
+ PARTLY FIXED (Abdel 2006-11-20): there's a full repaint only when the mouse is
+ released. More to come in this area.
* Too much painting 1 (Edwin 3/11/2006): when i click in the workarea (to put
the cursor in another part of the text) the screen is repainted *twice*
whereas it seems to me that no repainting is necessary at all.
-
-* Too much painting 2 (Edwin 3/11/2006): There is also a lot of painting going
- on when selecting text. When selecting a word the whole screen is repainted.
+ PARTLY FIXED (Abdel 2006-11-20): except for math insets.
* Too much painting 3 (Edwin 3/11/2006): the screen is repainted even when the
selection does not change (moving the mouse with the left button pushed down
always triggers a repaint).
+ PARTLY FIXED (Abdel 2006-11-20): When within the main text inset only the
+ current line is repainted.
* The cursor is not L-shaped for foreign languages
* M-x is broken (does not bring up the minibuffer).
FIXED (Bo, 2006-11-18): set toolbar flag in display function.
+* open a file; mark with the mouse and scroll; assert will fail:
+ FIXED (Abdel 2006-11-20): side effect of updateMetrics() cleanup.
+
+* Selection highlighting is broken. Test case: two paragraphs with "Hello"
+ and "World"; move cursor past "Wor", press Shift+Up
+ FIXED (Abdel 2006-11-20): side effect of updateMetrics() cleanup.
+
\ No newline at end of file
}
}
- update();
+ updateMetrics(false);
if (buffer_ && graphics::Previews::status() != LyXRC::PREVIEW_OFF)
graphics::Previews::get().generateBufferPreviews(*buffer_);
// The second drawing step is done in WorkArea::redraw() if needed.
// Case when no explicit update is requested.
- if (!(flags & (Update::SinglePar | Update::Force))) {
- if (fitCursor() || multiParSel()) {
- // a CoordCache update is needed
- updateMetrics(false);
- // tell the frontend to update the screen.
- return make_pair(true, false);
- }
+ if (!flags) {
// no need to do anything.
return make_pair(false, false);
}
- // We are now in the case (Update::SinglePar | Update::Force)
- bool single_par = flags & Update::SinglePar;
+ bool full_metrics = flags & Update::Force;
+ if (flags & Update::MultiParSel)
+ full_metrics |= multiParSel();
+
+ bool const single_par = !full_metrics;
updateMetrics(single_par);
- // Don't forget to do check for fitCursor() and multiParSel().
- fitCursor();
- multiParSel();
+ if (flags & Update::FitCursor && fitCursor())
+ updateMetrics(false);
+ // tell the frontend to update the screen.
return make_pair(true, single_par);
}
t.redoParagraph(*this, anchor_ref_);
int const h = t.getPar(anchor_ref_).height();
offset_ref_ = int((bar * t.paragraphs().size() - anchor_ref_) * h);
+ updateMetrics(false);
}
bool hasParWithID(int id) const;
/// This signal is emitted when the buffer is changed.
- boost::signal<void(bool)> changed;
+ boost::signal<void()> changed;
/// This signal is emitted when some parsing error shows up.
boost::signal<void(std::string)> errors;
/// This signal is emitted when some message shows up.
bufferChangedConnection_ =
buf.changed.connect(
- boost::bind(&WorkArea::redraw, work_area_, _1));
+ boost::bind(&WorkArea::redraw, work_area_));
errorsConnection_ =
buf.errors.connect(
}
-void WorkArea::redraw(bool singlePar)
+void WorkArea::redraw()
{
if (!buffer_view_ || !buffer_view_->buffer()) {
greyed_out_ = true;
return;
}
- buffer_view_->updateMetrics(singlePar && hasFocus());
+ // No need to do anything if this is the current view. The BufferView
+ // metrics are already up to date.
+ if (&lyx_view_ != &theApp->currentView())
+ // FIXME: it would be nice to optimize for the off-screen case.
+ buffer_view_->updateMetrics(false);
updateScrollbar();
toggleCursor();
if (needRedraw.first)
- redraw(needRedraw.second);
+ redraw();
}
virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
/// redraw the screen, without using existing pixmap
- virtual void redraw(bool singlePar = false);
+ virtual void redraw();
///
void stopBlinkingCursor();
void startBlinkingCursor();
std::pair<bool, bool> needSecondUpdate = view()->update(updateFlags);
if (needSecondUpdate.first)
- view()->buffer()->changed(needSecondUpdate.second);
+ view()->buffer()->changed();
lyx_view_->updateStatusBar();
///
bool cursorEnd(LCursor & cur);
///
- bool cursorPrevious(LCursor & cur);
+ void cursorPrevious(LCursor & cur);
///
- bool cursorNext(LCursor & cur);
+ void cursorNext(LCursor & cur);
///
bool cursorTop(LCursor & cur);
///
}
-bool LyXText::cursorPrevious(LCursor & cur)
+void LyXText::cursorPrevious(LCursor & cur)
{
pos_type cpos = cur.pos();
pit_type cpar = cur.pit();
int x = cur.x_target();
+ // FIXME: there would maybe a need for this 'updated' boolean in the future...
bool updated = setCursorFromCoordinates(cur, x, 0);
- if (updated)
- cur.bv().update();
updated |= cursorUp(cur);
if (cpar == cur.pit() && cpos == cur.pos()) {
}
finishUndo();
- return updated;
+ cur.updateFlags(Update::Force | Update::FitCursor);
}
-bool LyXText::cursorNext(LCursor & cur)
+void LyXText::cursorNext(LCursor & cur)
{
pos_type cpos = cur.pos();
pit_type cpar = cur.pit();
int x = cur.x_target();
+ // FIXME: there would maybe a need for this 'updated' boolean in the future...
bool updated = setCursorFromCoordinates(cur, x, cur.bv().workHeight() - 1);
- if (updated)
- cur.bv().update();
updated |= cursorDown(cur);
if (cpar == cur.pit() && cpos == cur.pos()) {
}
finishUndo();
- return updated;
+ cur.updateFlags(Update::Force | Update::FitCursor);
}
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_UP);
} else {
- needsUpdate |= cursorPrevious(cur);
+ cursorPrevious(cur);
}
break;
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_DOWN);
} else {
- needsUpdate |= cursorNext(cur);
+ cursorNext(cur);
}
break;