dim_.asc = 10;
dim_.des = 10;
- //text_->updateLabels(bv->buffer());
+ //text_->updateBuffer(bv->buffer());
}
void TextMetrics::applyOuterFont(Font & font) const
{
- Font lf(font_);
- lf.fontInfo().reduce(bv_->buffer().params().getFont().fontInfo());
- lf.fontInfo().realize(font.fontInfo());
- lf.setLanguage(font.language());
- font = lf;
+ FontInfo lf(font_.fontInfo());
+ lf.reduce(bv_->buffer().params().getFont().fontInfo());
+ font.fontInfo().realize(lf);
}
bool TextMetrics::redoParagraph(pit_type const pit)
{
Paragraph & par = text_->getPar(pit);
- // IMPORTANT NOTE: We pass 'false' explicitely in order to not call
+ // IMPORTANT NOTE: We pass 'false' explicitly in order to not call
// redoParagraph() recursively inside parMetrics.
Dimension old_dim = parMetrics(pit, false).dim();
ParagraphMetrics & pm = par_metrics_[pit];
LYXERR(Debug::INFO, "MacroContext not initialised!"
<< " Going through the buffer again and hope"
<< " the context is better then.");
- bv_->buffer().updateLabels();
+ bv_->buffer().updateBuffer();
parPos = text_->macrocontextPosition();
LASSERT(!parPos.empty(), /**/);
parPos.pit() = pit;
return 0;
}
+ // if the first character is a separator, we are in RTL
+ // text. This character will not be painted on screen
+ // and thus we should not count it and skip to the next.
+ if (par.isSeparator(bidi.vis2log(vc)))
+ ++vc;
+
while (vc < end && tmpx <= x) {
c = bidi.vis2log(vc);
last_tmpx = tmpx;
if (yy + rit->height() > y)
break;
- if (assert_in_view && yy + rit->height() != y) {
- if (!up) {
+ if (assert_in_view) {
+ if (!up && yy + rit->height() > y) {
if (rit != pm.rows().begin()) {
y = yy;
--rit;
--rit;
y = yy;
}
- } else {
+ } else if (up && yy != y) {
if (rit != rlast) {
y = yy + rit->height();
++rit;
- } else if (pit != int(par_metrics_.size())) {
+ } else if (pit < int(text_->paragraphs().size()) - 1) {
++pit;
newParMetricsDown();
ParagraphMetrics const & pm2 = par_metrics_[pit];
int yy = y; // is modified by getPitAndRowNearY
Row const & row = getPitAndRowNearY(yy, pit, assert_in_view, up);
- bool bound = false;
+ bool bound = false; // is modified by getColumnNearX
int xx = x; // is modified by getColumnNearX
pos_type const pos = row.pos()
+ getColumnNearX(pit, row, xx, bound);
}
ParagraphList const & pars = text_->paragraphs();
- Inset const * insetBefore = pos ? pars[pit].getInset(pos - 1) : 0;
- //Inset * insetBehind = pars[pit].getInset(pos);
+ Inset const * inset_before = pos ? pars[pit].getInset(pos - 1) : 0;
// This should be just before or just behind the
// cursor position set above.
- LASSERT((pos != 0 && inset == insetBefore)
+ LASSERT(inset == inset_before
|| inset == pars[pit].getInset(pos), /**/);
// Make sure the cursor points to the position before
// this inset.
- if (inset == insetBefore) {
+ if (inset == inset_before) {
--cur.pos();
cur.boundary(false);
}