From 61f1f3ea874eb132f4061acc95c6870db75020d7 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 15 Sep 2003 10:08:01 +0000 Subject: [PATCH] Define explicitly the color passed to the painter. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7748 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/insets/ChangeLog | 5 +++++ src/insets/insetlatexaccent.C | 22 +++++++++++++--------- src/insets/renderers.C | 3 ++- src/mathed/ChangeLog | 3 +++ src/mathed/math_gridinset.C | 8 ++++++-- src/rowpainter.C | 13 +++++++------ 7 files changed, 41 insertions(+), 18 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index fe0616a8c7..b2fb0bfd44 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-09-15 Angus Leeming + + * rowpainter.C (paintLengthMarker, paintPageBreak, paintAppendixStart): + explicitly define the color passed to the painter. + 2003-09-15 Angus Leeming * bufferparams.C (BufferParams): reorder member initializers to avoid diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index b2b83d6fad..fbfce3d9c4 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2003-09-15 Angus Leeming + + * renderers.C (draw): + * insetlatexaccent.C (draw): explicitly define the color passed to the painter. + 2003-09-10 Martin Vermeer * insettext.C: remove block causing problems in lockInsetInInset diff --git a/src/insets/insetlatexaccent.C b/src/insets/insetlatexaccent.C index bb4f2e3f9b..2b225a7ea2 100644 --- a/src/insets/insetlatexaccent.C +++ b/src/insets/insetlatexaccent.C @@ -487,13 +487,15 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const case TIE: // tie { pi.pain.arc(int(x2 + hg35), int(y + hg / 2.0), - int(2 * hg), int(hg), 0, 360 * 32); + int(2 * hg), int(hg), 0, 360 * 32, + LColor::foreground); break; } case BREVE: // breve { pi.pain.arc(int(x2 - (hg / 2.0)), y, - int(hg), int(hg), 0, -360*32); + int(hg), int(hg), 0, -360*32, + LColor::foreground); break; } case CARON: // caron @@ -503,7 +505,7 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const xp[0] = int(x2 - hg35); yp[0] = int(y + hg35); xp[1] = int(x2); yp[1] = int(y + hg); xp[2] = int(x2 + hg35); yp[2] = int(y + hg35); - pi.pain.lines(xp, yp, 3); + pi.pain.lines(xp, yp, 3, LColor::foreground); break; } case SPECIAL_CARON: // special caron @@ -522,7 +524,7 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const xp[2] = int(x + dim_.wid + (hg35 / 2.0)); yp[2] = y + int(hg); - pi.pain.lines(xp, yp, 3); + pi.pain.lines(xp, yp, 3, LColor::foreground); break; } case HUNGARIAN_UMLAUT: // hung. umlaut @@ -569,7 +571,7 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const xp[3] = int(x2 + hg / 4.0); yp[3] = y + int(hg); - pi.pain.lines(xp, yp, 4); + pi.pain.lines(xp, yp, 4, LColor::foreground); break; } case lSLASH: @@ -583,7 +585,7 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const xp[1] = int(x + float(dim_.wid) * 0.75); yp[1] = y + int(hg); - pi.pain.lines(xp, yp, 2); + pi.pain.lines(xp, yp, 2, LColor::foreground); break; } case DOT_LESS_I: // dotless-i @@ -595,10 +597,12 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const } } else { pi.pain.fillRectangle(x + 1, - baseline - dim_.asc + 1, dim_.wid - 2, - dim_.asc + dim_.des - 2, backgroundColor()); + baseline - dim_.asc + 1, dim_.wid - 2, + dim_.asc + dim_.des - 2, + backgroundColor()); pi.pain.rectangle(x + 1, baseline - dim_.asc + 1, - dim_.wid - 2, dim_.asc + dim_.des - 2); + dim_.wid - 2, dim_.asc + dim_.des - 2, + LColor::foreground); pi.pain.text(x + 2, baseline, contents, font); } } diff --git a/src/insets/renderers.C b/src/insets/renderers.C index 1e80eafe90..59fa2e4509 100644 --- a/src/insets/renderers.C +++ b/src/insets/renderers.C @@ -281,7 +281,8 @@ void GraphicRenderer::draw(PainterInfo & pi, int x, int y) const pi.pain.rectangle(x + InsetOld::TEXT_TO_INSET_OFFSET, y - dim_.asc, dim_.wid - 2 * InsetOld::TEXT_TO_INSET_OFFSET, - dim_.asc + dim_.des); + dim_.asc + dim_.des, + LColor::foreground); // Print the file name. LyXFont msgFont = pi.base.font; diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index e980d12884..14ee801ee0 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,6 @@ +2003-09-15 Angus Leeming + + * math_gridinset.C (draw): explicitly define the color to draw the line. 2003-09-12 André Pönitz diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index ade73f9904..5fd2267875 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -469,14 +469,18 @@ void MathGridInset::draw(PainterInfo & pi, int x, int y) const for (int i = 0; i < rowinfo_[row].lines_; ++i) { int yy = y + rowinfo_[row].offset_ - rowinfo_[row].ascent_ - i * hlinesep() - hlinesep()/2 - rowsep()/2; - pi.pain.line(x + 1, yy, x + dim_.width() - 1, yy); + pi.pain.line(x + 1, yy, + x + dim_.width() - 1, yy, + LColor::foreground); } for (col_type col = 0; col <= ncols(); ++col) for (int i = 0; i < colinfo_[col].lines_; ++i) { int xx = x + colinfo_[col].offset_ - i * vlinesep() - vlinesep()/2 - colsep()/2; - pi.pain.line(xx, y - dim_.ascent() + 1, xx, y + dim_.descent() - 1); + pi.pain.line(xx, y - dim_.ascent() + 1, + xx, y + dim_.descent() - 1, + LColor::foreground); } } diff --git a/src/rowpainter.C b/src/rowpainter.C index 699fb2d526..e380f3e468 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -600,8 +600,9 @@ int RowPainter::paintLengthMarker(string const & prefix, VSpace const & vsp, int font_metrics::rectText(str, font, w, a, d); pain_.rectText(leftx + 2 * arrow_size + 5, - start + ((end - start) / 2) + d, - str, font); + start + ((end - start) / 2) + d, + str, font, + LColor::none, LColor::none); // top arrow pain_.line(leftx, ty1, midx, ty2, LColor::added_space); @@ -631,12 +632,12 @@ int RowPainter::paintPageBreak(string const & label, int y) int const text_start = int(xo_ + (width_ - w) / 2); int const text_end = text_start + w; - pain_.rectText(text_start, y + d, label, pb_font); + pain_.rectText(text_start, y + d, label, pb_font, LColor::none, LColor::none); pain_.line(int(xo_), y, text_start, y, - LColor::pagebreak, Painter::line_onoffdash); + LColor::pagebreak, Painter::line_onoffdash); pain_.line(text_end, y, int(xo_ + width_), y, - LColor::pagebreak, Painter::line_onoffdash); + LColor::pagebreak, Painter::line_onoffdash); return 3 * defaultRowHeight(); } @@ -656,7 +657,7 @@ int RowPainter::paintAppendixStart(int y) int const text_start = int(xo_ + (width_ - w) / 2); int const text_end = text_start + w; - pain_.rectText(text_start, y + d, label, pb_font); + pain_.rectText(text_start, y + d, label, pb_font, LColor::none, LColor::none); pain_.line(int(xo_ + 1), y, text_start, y, LColor::appendix); pain_.line(text_end, y, int(xo_ + width_ - 2), y, LColor::appendix);