From: Abdelrazak Younes Date: Wed, 5 Dec 2007 23:10:11 +0000 (+0000) Subject: InsetHFill drawing: some other tweaks. There's still a problem with cursor positionni... X-Git-Tag: 1.6.10~7037 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=920c3c3e366b8452f62b170361ffffc56fd08199;p=features.git 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 --- diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index dc75322e35..737024af1b 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -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); diff --git a/src/insets/InsetHFill.cpp b/src/insets/InsetHFill.cpp index cde96a05a6..cc02b0b6c8 100644 --- a/src/insets/InsetHFill.cpp +++ b/src/insets/InsetHFill.cpp @@ -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); }