mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
InsetHFill drawing: some other tweaks. There's still a problem with cursor positionning and selection when the hfill is not expanded.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21985 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9536a8a651
commit
920c3c3e36
@ -655,7 +655,7 @@ void TextMetrics::computeRowMetrics(pit_type const pit,
|
||||
if (pm.hfillExpansion(row, ii->pos))
|
||||
dim.wid = int(ii->pos >= body_pos ? row.hfill : row.label_hfill);
|
||||
else
|
||||
dim.wid = 0;
|
||||
dim.wid = 3;
|
||||
// Cache the inset dimension.
|
||||
bv_->coordCache().insets().add(ii->inset, dim);
|
||||
pm.setInsetDimension(ii->inset, dim);
|
||||
|
@ -54,19 +54,13 @@ void InsetHFill::metrics(MetricsInfo &, Dimension & dim) const
|
||||
void InsetHFill::draw(PainterInfo & pi, int x, int y) const
|
||||
{
|
||||
Dimension const dim = Inset::dimension(*pi.base.bv);
|
||||
x += 1;
|
||||
|
||||
int const x0 = x + 1;
|
||||
int const x1 = x + dim.wid - 2;
|
||||
int const y0 = y + dim.des;
|
||||
int const y1 = y - dim.asc;
|
||||
|
||||
pi.pain.line(x, y1, x, y0, Color_added_space);
|
||||
if (dim.wid == 0)
|
||||
// The HFill is not expanded.
|
||||
return;
|
||||
|
||||
int const x1 = x + dim.wid - 2;
|
||||
|
||||
pi.pain.line(x, y, x1, y, Color_added_space,
|
||||
pi.pain.line(x0, y1, x0, y0, Color_added_space);
|
||||
pi.pain.line(x0, y, x1, y, Color_added_space,
|
||||
frontend::Painter::line_onoffdash);
|
||||
pi.pain.line(x1, y1, x1, y0, Color_added_space);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user