}
+ /*
/// moves position closest to (x, y) in given box
bool bruteFind(Cursor & cursor,
int x, int y, int xlow, int xhigh, int ylow, int yhigh)
return false;
}
+ */
/// moves position closest to (x, y) in given box
void Cursor::setScreenPos(int x, int y)
{
setTargetX(x);
- bruteFind(*this, x, y, 0, bv().workWidth(), 0, bv().workHeight());
+ //bruteFind(*this, x, y, 0, bv().workWidth(), 0, bv().workHeight());
}
if (pos > 0) {
TextMetrics const & tm = bv().textMetrics(&text);
if (pos == sl.lastpos()
- || (par.isSeparator(pos) &&
- !tm.isRTLBoundary(par, pos)))
+ || (par.isSeparator(pos)
+ && !tm.isRTLBoundary(sl.pit(), pos)))
--pos;
}
void Cursor::setCurrentFont()
{
- pos_type cpos = pos();
- Paragraph & par = paragraph();
- Text const & ctext = *text();
+ CursorSlice const & cs = innerTextSlice();
+ Paragraph const & par = cs.paragraph();
+ pos_type cpit = cs.pit();
+ pos_type cpos = cs.pos();
+ Text const & ctext = *cs.text();
TextMetrics const & tm = bv().textMetrics(&ctext);
// are we behind previous char in fact? -> go to that char
// abc| def -> font of c
// abc |[WERBEH], i.e. boundary==true -> font of c
// abc [WERBEH]| def, font of the space
- if (!tm.isRTLBoundary(par, cpos))
+ if (!tm.isRTLBoundary(cpit, cpos))
--cpos;
}
}
// get font
BufferParams const & bufparams = buffer().params();
current_font = par.getFontSettings(bufparams, cpos);
- real_current_font = tm.getDisplayFont(par, cpos);
+ real_current_font = tm.getDisplayFont(cpit, cpos);
// special case for paragraph end
- if (pos() == lastpos()
- && tm.isRTLBoundary(par, pos())
+ if (cs.pos() == lastpos()
+ && tm.isRTLBoundary(cpit, cs.pos())
&& !boundary()) {
Language const * lang = par.getParLanguage(bufparams);
current_font.setLanguage(lang);