mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-20 06:49:56 +00:00
painter fixes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5259 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b2e770a640
commit
befc233488
@ -1,3 +1,9 @@
|
|||||||
|
2002-09-11 John Levon <levon@movementarian.org>
|
||||||
|
|
||||||
|
* qfont_metrics.C: fix button metrics
|
||||||
|
|
||||||
|
* QLPainter.C: fillPolygon() should actually fill
|
||||||
|
|
||||||
2002-09-10 John Levon <levon@movementarian.org>
|
2002-09-10 John Levon <levon@movementarian.org>
|
||||||
|
|
||||||
* Menubar_pimpl.C:
|
* Menubar_pimpl.C:
|
||||||
|
@ -138,6 +138,7 @@ Painter & QLPainter::rectangle(int x, int y,
|
|||||||
line_style ls,
|
line_style ls,
|
||||||
line_width lw)
|
line_width lw)
|
||||||
{
|
{
|
||||||
|
//lyxerr << "rectangle " << x<<","<<y << " " <<w<<","<<h<<endl;
|
||||||
setPen(col, ls, lw).drawRect(x, y, w, h);
|
setPen(col, ls, lw).drawRect(x, y, w, h);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -147,6 +148,7 @@ Painter & QLPainter::fillRectangle(int x, int y,
|
|||||||
int w, int h,
|
int w, int h,
|
||||||
LColor::color col)
|
LColor::color col)
|
||||||
{
|
{
|
||||||
|
//lyxerr << "fillRectangle " << x<<","<<y << " " <<w<<","<<h<<endl;
|
||||||
qp_->fillRect(x, y, w, h, QColor(lcolor.getX11Name(col).c_str()));
|
qp_->fillRect(x, y, w, h, QColor(lcolor.getX11Name(col).c_str()));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -155,11 +157,10 @@ Painter & QLPainter::fillRectangle(int x, int y,
|
|||||||
Painter & QLPainter::fillPolygon(int const * xp, int const * yp,
|
Painter & QLPainter::fillPolygon(int const * xp, int const * yp,
|
||||||
int np, LColor::color col)
|
int np, LColor::color col)
|
||||||
{
|
{
|
||||||
// FIXME ?
|
|
||||||
|
|
||||||
// Must use new as np is not known at compile time.
|
// Must use new as np is not known at compile time.
|
||||||
boost::scoped_array<QCOORD> points(new QCOORD[np * 2]);
|
boost::scoped_array<QCOORD> points(new QCOORD[np * 2]);
|
||||||
|
|
||||||
|
//if (1) return *this;
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
for (int i = 0; i < np; ++i) {
|
for (int i = 0; i < np; ++i) {
|
||||||
@ -167,7 +168,10 @@ Painter & QLPainter::fillPolygon(int const * xp, int const * yp,
|
|||||||
points[j++] = yp[i];
|
points[j++] = yp[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
setPen(col).drawPolygon(QPointArray(np, points.get()));
|
setPen(col);
|
||||||
|
qp_->setBrush(lcolor.getX11Name(col).c_str());
|
||||||
|
qp_->drawPolygon(QPointArray(np, points.get()));
|
||||||
|
qp_->setBrush(Qt::NoBrush);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,6 @@ QLImage
|
|||||||
|
|
||||||
QLPainter
|
QLPainter
|
||||||
|
|
||||||
- work out why buttons look ugly and fix
|
|
||||||
- check ::arc() works
|
- check ::arc() works
|
||||||
|
|
||||||
QLyXKeySym
|
QLyXKeySym
|
||||||
|
@ -112,9 +112,11 @@ void rectText(string const & str, LyXFont const & f,
|
|||||||
{
|
{
|
||||||
QFontMetrics const & m(metrics(f));
|
QFontMetrics const & m(metrics(f));
|
||||||
|
|
||||||
w = width(str, f);
|
static int const d = 2;
|
||||||
ascent = m.ascent();
|
|
||||||
descent = m.descent();
|
w = width(str, f) + d * 2 + 2;
|
||||||
|
ascent = m.ascent() + d;
|
||||||
|
descent = m.descent() + d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user