]> git.lyx.org Git - lyx.git/commitdiff
Let InsetSpecialChar draw its background when necessary
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 4 Aug 2016 21:20:18 +0000 (23:20 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 4 Aug 2016 21:21:33 +0000 (23:21 +0200)
This is the same fix as in 9940acc5 for auote inset and math macro template.

src/insets/InsetSpecialChar.cpp
src/insets/InsetSpecialChar.h

index 3d32f406ea1bc812ac8553c303e8eeb6000c22af..6554cce16e552078a3ad0d01bde208333c01a01f 100644 (file)
@@ -134,6 +134,16 @@ void InsetSpecialChar::metrics(MetricsInfo & mi, Dimension & dim) const
 }
 
 
+void InsetSpecialChar::drawBackground(PainterInfo & pi, int x, int y) const
+{
+       if (pi.full_repaint)
+               return;
+       Dimension const dim = dimension(*pi.base.bv);
+       pi.pain.fillRectangle(x, y - dim.asc, dim.wid, dim.asc + dim.des,
+                             pi.backgroundColor(this));
+}
+
+
 namespace {
 
 // helper function: draw text and update x.
index a5761864d8ca1cce7d6461067312b98d7eb09574..a57f9df89bca071dda54599f4ee572ffd5d3a58f 100644 (file)
@@ -61,6 +61,8 @@ public:
        ///
        void metrics(MetricsInfo &, Dimension &) const;
        ///
+       void drawBackground(PainterInfo & pi, int x, int y) const;
+       ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
        void write(std::ostream &) const;