]> git.lyx.org Git - features.git/commitdiff
InsetHFill drawing: some other tweaks. There's still a problem with cursor positionni...
authorAbdelrazak Younes <younes@lyx.org>
Wed, 5 Dec 2007 23:10:11 +0000 (23:10 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 5 Dec 2007 23:10:11 +0000 (23:10 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21985 a592a061-630c-0410-9148-cb99ea01b6c8

src/TextMetrics.cpp
src/insets/InsetHFill.cpp

index dc75322e3565538dd3fc7296e6786c34b1460d5e..737024af1b7439cf8884bfe495398f0533d88005 100644 (file)
@@ -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);
index cde96a05a6813175b930aa0ac67deacab32a0b24..cc02b0b6c81fcb246e50f34ec7bfe4b0fd222754 100644 (file)
@@ -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);
 }