mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-22 07:42:02 +00:00
- y - (-y) is pretty close to 0
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7440 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7ba25c6e3b
commit
184b5dadaf
@ -321,30 +321,28 @@ void LyXScreen::toggleSelection(LyXText * text, BufferView * bv,
|
|||||||
int yo, int xo)
|
int yo, int xo)
|
||||||
{
|
{
|
||||||
// only if there is a selection
|
// only if there is a selection
|
||||||
if (!text->selection.set()) return;
|
if (!text->selection.set())
|
||||||
|
return;
|
||||||
|
|
||||||
int const bottom = min(
|
int const bottom = min(
|
||||||
max(static_cast<int>(text->selection.end.y()
|
max(int(text->selection.end.y()
|
||||||
- text->getRow(text->selection.end)->baseline()
|
- text->getRow(text->selection.end)->baseline()
|
||||||
+ text->getRow(text->selection.end)->height()),
|
+ text->getRow(text->selection.end)->height()),
|
||||||
text->top_y()),
|
text->top_y()),
|
||||||
static_cast<int>(text->top_y() + workarea().workHeight()));
|
int(text->top_y() + workarea().workHeight()));
|
||||||
int const top = min(
|
int const top = min(
|
||||||
max(static_cast<int>(text->selection.start.y() -
|
max(int(text->selection.start.y() -
|
||||||
text->getRow(text->selection.start)->baseline()),
|
text->getRow(text->selection.start)->baseline()),
|
||||||
text->top_y()),
|
text->top_y()),
|
||||||
static_cast<int>(text->top_y() + workarea().workHeight()));
|
int(text->top_y() + workarea().workHeight()));
|
||||||
|
|
||||||
if (kill_selection)
|
if (kill_selection)
|
||||||
text->selection.set(false);
|
text->selection.set(false);
|
||||||
|
|
||||||
workarea().getPainter().start();
|
workarea().getPainter().start();
|
||||||
|
|
||||||
drawFromTo(text, bv, top - text->top_y(), bottom - text->top_y(),
|
drawFromTo(text, bv, top - text->top_y(), bottom - text->top_y(), yo, xo);
|
||||||
yo, xo);
|
expose(0, top - text->top_y(), workarea().workWidth(), bottom - top);
|
||||||
expose(0, top - text->top_y(),
|
|
||||||
workarea().workWidth(),
|
|
||||||
bottom - text->top_y() - (top - text->top_y()));
|
|
||||||
|
|
||||||
workarea().getPainter().end();
|
workarea().getPainter().end();
|
||||||
}
|
}
|
||||||
|
@ -404,8 +404,7 @@ LyXFont const Paragraph::getFontSettings(BufferParams const & bparams,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lyx::pos_type
|
lyx::pos_type Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
|
||||||
Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
|
|
||||||
{
|
{
|
||||||
Assert(pos <= size());
|
Assert(pos <= size());
|
||||||
|
|
||||||
|
@ -860,7 +860,7 @@ pos_type LyXText::rowBreakPoint(Row const & row) const
|
|||||||
chunkwidth += thiswidth;
|
chunkwidth += thiswidth;
|
||||||
|
|
||||||
InsetOld * in = pit->isInset(i) ? pit->getInset(i) : 0;
|
InsetOld * in = pit->isInset(i) ? pit->getInset(i) : 0;
|
||||||
fullrow = (in && (in->display() || in->needFullRow()));
|
fullrow = in && (in->display() || in->needFullRow());
|
||||||
|
|
||||||
// break before a character that will fall off
|
// break before a character that will fall off
|
||||||
// the right of the row
|
// the right of the row
|
||||||
@ -971,7 +971,7 @@ int LyXText::fill(RowList::iterator row, int paper_width) const
|
|||||||
font = getFont(pit, i);
|
font = getFont(pit, i);
|
||||||
endPosOfFontSpan = pit->getEndPosOfFontSpan(i);
|
endPosOfFontSpan = pit->getEndPosOfFontSpan(i);
|
||||||
}
|
}
|
||||||
if (! font.language()->RightToLeft()) {
|
if (!font.language()->RightToLeft()) {
|
||||||
w += font_metrics::width(c, font);
|
w += font_metrics::width(c, font);
|
||||||
} else {
|
} else {
|
||||||
// Fall-back to the normal case
|
// Fall-back to the normal case
|
||||||
|
Loading…
x
Reference in New Issue
Block a user