For reference, the bug was that quote insets grew bolder because, when
painted over themselves, anti-aliasing made them darker.
It turned out that the fix there created others than were
painstakingly fixed: #7164, #7165, #7174, #7193... More recently, it
created other problems:
http://article.gmane.org/gmane.editors.lyx.devel/163471
We use the right fix here:
* draw background of quote inset when not doing full repaint
* draw background of math macro template when not doing full repaint
* remove hack that grew from #4889 fix.
Row::const_iterator const & end = row_.end();
for ( ; cit != end ; ++cit) {
Row::Element const & e = *cit;
Row::const_iterator const & end = row_.end();
for ( ; cit != end ; ++cit) {
Row::Element const & e = *cit;
- if (e.type == Row::INSET) {
- // If outer row has changed, nested insets are repainted completely.
- // FIXME: check what this really does. The test is weird.
- bool const nested_inset =
- (e.inset->asInsetMath() && !e.inset->asInsetMath()->asMacroTemplate())
- || e.inset->asInsetText() || e.inset->asInsetTabular();
- if (nested_inset)
+ if (e.type == Row::INSET)
x_ += e.full_width();
}
}
x_ += e.full_width();
}
}
+void InsetQuotes::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));
+}
+
+
void InsetQuotes::draw(PainterInfo & pi, int x, int y) const
{
FontInfo font = pi.base.font;
void InsetQuotes::draw(PainterInfo & pi, int x, int y) const
{
FontInfo font = pi.base.font;
///
void metrics(MetricsInfo &, Dimension &) const;
///
///
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;
void draw(PainterInfo & pi, int x, int y) const;
///
void write(std::ostream &) const;
+void MathMacroTemplate::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));
+}
+
+
+
void MathMacroTemplate::draw(PainterInfo & pi, int x, int y) const
{
// FIXME: Calling Changer on the same object repeatedly is inefficient.
void MathMacroTemplate::draw(PainterInfo & pi, int x, int y) const
{
// FIXME: Calling Changer on the same object repeatedly is inefficient.
///
void draw(PainterInfo & pi, int x, int y) const;
///
///
void draw(PainterInfo & pi, int x, int y) const;
///
+ void drawBackground(PainterInfo & pi, int x, int y) const;
+ ///
void metrics(MetricsInfo & mi, Dimension & dim) const;
/// identifies macro templates
MathMacroTemplate * asMacroTemplate() { return this; }
void metrics(MetricsInfo & mi, Dimension & dim) const;
/// identifies macro templates
MathMacroTemplate * asMacroTemplate() { return this; }