]> git.lyx.org Git - features.git/commitdiff
fix deco drawing bug.
authorAndré Pönitz <poenitz@gmx.net>
Thu, 8 Apr 2004 15:20:05 +0000 (15:20 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 8 Apr 2004 15:20:05 +0000 (15:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8633 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_decorationinset.C
src/mathed/math_dotsinset.C
src/mathed/math_support.C

index e2dfb63bcec4a06ca75588d205167323b8721dad..ba9ab175c2a326094d4f66b384ef5eccf38d520d 100644 (file)
@@ -17,6 +17,9 @@
 #include "math_parser.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
+
+#include "debug.h"
+
 #include "support/std_ostream.h"
 
 using std::auto_ptr;
@@ -107,11 +110,12 @@ void MathDecorationInset::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void MathDecorationInset::draw(PainterInfo & pi, int x, int y) const
 {
+       lyxerr << "MathDecorationInset::draw: x: " << x << std::endl;
        cell(0).draw(pi, x + 1, y);
        if (wide())
                mathed_draw_deco(pi, x + 1, y + dy_, cell(0).width(), dh_, key_->name);
        else
-               mathed_draw_deco(pi, x + 1 + (pi.width - dw_) / 2,
+               mathed_draw_deco(pi, x + 1 + (cell(0).width() - dw_) / 2,
                        y + dy_, dw_, dh_, key_->name);
        drawMarkers(pi, x, y);
 }
index c08c31a443c2327066278b51e498d15fe2ad1934..8ab3afe6feec3c4f4b2d737091087297c96cef60 100644 (file)
@@ -34,20 +34,20 @@ auto_ptr<InsetBase> MathDotsInset::clone() const
 
 void MathDotsInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       mathed_char_dim(mi.base.font, 'M', dim_);
+       mathed_char_dim(mi.base.font, 'M', dim);
        dh_ = 0;
        if (key_->name == "cdots" || key_->name == "dotsb"
                        || key_->name == "dotsm" || key_->name == "dotsi")
-               dh_ = dim_.asc / 2;
+               dh_ = dim.asc / 2;
        else if (key_->name == "dotsc")
-               dh_ = dim_.asc / 4;
+               dh_ = dim.asc / 4;
        else if (key_->name == "vdots") {
-               dim_.wid = (dim_.wid / 2) + 1;
-               dh_ = dim_.asc;
+               dim.wid = (dim.wid / 2) + 1;
+               dh_ = dim.asc;
        }
        else if (key_->name == "ddots")
-               dh_ = dim_.asc;
-       dim = dim_;
+               dh_ = dim.asc;
+       dim_ = dim;
 }
 
 
@@ -61,6 +61,7 @@ void MathDotsInset::draw(PainterInfo & pain, int x, int y) const
                --y;
        mathed_draw_deco(pain, x + 2, y - dh_, dim_.width() - 2, dim_.ascent(),
                key_->name);
+       setPosCache(pain, x, y);
 }
 
 
index 29e117df28686bf9deb32ebcbb3ab835a7183f94..f1f979a9025a2ac3712ec09d471a9371918e3b9c 100644 (file)
@@ -458,7 +458,15 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
                                int(x + xx + 0.5), int(y + yy + 0.5),
                                int(x + x2 + 0.5), int(y + y2 + 0.5),
                                LColor::math);
-               }       else {
+
+                       lyxerr << "drew line "
+                              << "xx=" << xx << ", yy=" << yy
+                              << ", x2 = " << x2 << ", y2 = " << y2 << '\n'
+                              << int(x + xx + 0.5) << ", "
+                              << int(y + yy + 0.5) << ", "
+                              << int(x + x2 + 0.5) << ", "
+                              << int(y + y2 + 0.5) << std::endl;
+               } else {
                        int xp[32];
                        int yp[32];
                        int const n = int(d[i++]);