* InsetHFill: small drawing tweaks and fix the cursor positionning and selection of the inset.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21988 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-12-06 08:51:56 +00:00
parent eb96d94ce7
commit 6fef639091
2 changed files with 5 additions and 4 deletions

View File

@ -651,9 +651,10 @@ void TextMetrics::computeRowMetrics(pit_type const pit,
continue;
Dimension dim = row.dimension();
if (pm.hfillExpansion(row, ii->pos))
dim.wid = int(ii->pos >= body_pos ? hfill : row.label_hfill);
dim.wid = int(ii->pos >= body_pos ?
max(hfill, 5.0) : row.label_hfill);
else
dim.wid = 3;
dim.wid = 5;
// Cache the inset dimension.
bv_->coordCache().insets().add(ii->inset, dim);
pm.setInsetDimension(ii->inset, dim);

View File

@ -56,8 +56,8 @@ void InsetHFill::draw(PainterInfo & pi, int x, int y) const
Dimension const dim = Inset::dimension(*pi.base.bv);
int const x0 = x + 1;
int const x1 = x + dim.wid - 2;
int const y0 = y + dim.des;
int const y1 = y - dim.asc;
int const y0 = y + dim.des - 1;
int const y1 = y - dim.asc + 1;
pi.pain.line(x0, y1, x0, y0, Color_added_space);
pi.pain.line(x0, y, x1, y, Color_added_space,