mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
* only antialias the whole polyline or no segment at all
* Sqrt and Root draw their vertical horizontal line with a single line command to make them showup non-antialiased. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18419 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
725aab6154
commit
96860ffe93
@ -113,16 +113,22 @@ void QLPainter::lines(int const * xp, int const * yp, int np,
|
|||||||
{
|
{
|
||||||
if (!isDrawingEnabled())
|
if (!isDrawingEnabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool const text_is_antialiased = renderHints() & TextAntialiasing;
|
// Must use new as np is not known at compile time.
|
||||||
setQPainterPen(col, ls, lw);
|
boost::scoped_array<QPoint> points(new QPoint[np]);
|
||||||
for (int i = 1; i < np; ++i) {
|
|
||||||
bool const do_antialiasing = text_is_antialiased
|
bool antialias = false;
|
||||||
&& xp[i-1] != xp[i] && yp[i-1] != yp[i];
|
for (int i = 0; i < np; ++i) {
|
||||||
setRenderHint(Antialiasing, do_antialiasing);
|
points[i].setX(xp[i]);
|
||||||
drawLine(xp[i-1], yp[i-1], xp[i], yp[i]);
|
points[i].setY(yp[i]);
|
||||||
setRenderHint(Antialiasing, false);
|
if (i != 0)
|
||||||
|
antialias |= xp[i-1] != xp[i] && yp[i-1] != yp[i];
|
||||||
}
|
}
|
||||||
|
setQPainterPen(col, ls, lw);
|
||||||
|
bool const text_is_antialiased = renderHints() & TextAntialiasing;
|
||||||
|
setRenderHint(Antialiasing, antialias && text_is_antialiased);
|
||||||
|
drawPolyline(points.get(), np);
|
||||||
|
setRenderHint(Antialiasing, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,14 +61,15 @@ void InsetMathRoot::draw(PainterInfo & pi, int x, int y) const
|
|||||||
cell(1).draw(pi, x + w + 8, y);
|
cell(1).draw(pi, x + w + 8, y);
|
||||||
int const a = dim_.ascent();
|
int const a = dim_.ascent();
|
||||||
int const d = dim_.descent();
|
int const d = dim_.descent();
|
||||||
int xp[5];
|
int xp[4];
|
||||||
int yp[5];
|
int yp[4];
|
||||||
xp[0] = x + dim_.width(); yp[0] = y - a + 1;
|
pi.pain.line(x + dim_.width(), y - a + 1,
|
||||||
xp[1] = x + w + 4; yp[1] = y - a + 1;
|
x + w + 4, y - a + 1, Color::math);
|
||||||
xp[2] = x + w; yp[2] = y + d;
|
xp[0] = x + w + 4; yp[0] = y - a + 1;
|
||||||
xp[3] = x + w - 2; yp[3] = y + (d - a)/2 + 2;
|
xp[1] = x + w; yp[1] = y + d;
|
||||||
xp[4] = x + w - 5; yp[4] = y + (d - a)/2 + 4;
|
xp[2] = x + w - 2; yp[2] = y + (d - a)/2 + 2;
|
||||||
pi.pain.lines(xp, yp, 5, Color::math);
|
xp[3] = x + w - 5; yp[3] = y + (d - a)/2 + 4;
|
||||||
|
pi.pain.lines(xp, yp, 4, Color::math);
|
||||||
drawMarkers(pi, x, y);
|
drawMarkers(pi, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,13 +53,14 @@ void InsetMathSqrt::draw(PainterInfo & pi, int x, int y) const
|
|||||||
cell(0).draw(pi, x + 10, y);
|
cell(0).draw(pi, x + 10, y);
|
||||||
int const a = dim_.ascent();
|
int const a = dim_.ascent();
|
||||||
int const d = dim_.descent();
|
int const d = dim_.descent();
|
||||||
int xp[4];
|
int xp[3];
|
||||||
int yp[4];
|
int yp[3];
|
||||||
xp[0] = x + dim_.width(); yp[0] = y - a + 1;
|
pi.pain.line(x + dim_.width(), y - a + 1,
|
||||||
xp[1] = x + 8; yp[1] = y - a + 1;
|
x + 8, y - a + 1, Color::math);
|
||||||
xp[2] = x + 5; yp[2] = y + d - 1;
|
xp[0] = x + 8; yp[0] = y - a + 1;
|
||||||
xp[3] = x; yp[3] = y + (d - a)/2;
|
xp[1] = x + 5; yp[1] = y + d - 1;
|
||||||
pi.pain.lines(xp, yp, 4, Color::math);
|
xp[2] = x; yp[2] = y + (d - a)/2;
|
||||||
|
pi.pain.lines(xp, yp, 3, Color::math);
|
||||||
drawMarkers(pi, x, y);
|
drawMarkers(pi, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user