Diagram : draw the points of the grid only inside the diagram

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3826 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-03-14 21:40:44 +00:00
parent 48de36f759
commit 8919e8e690

View File

@@ -134,12 +134,13 @@ void Diagram::drawBackground(QPainter *p, const QRectF &r) {
p->setPen(pen); p->setPen(pen);
p -> setBrush(Qt::NoBrush); p -> setBrush(Qt::NoBrush);
qreal limite_x = r.x() + r.width(); QRectF rect = drawingRect().intersected(r);
qreal limite_y = r.y() + r.height(); qreal limite_x = rect.x() + rect.width();
qreal limite_y = rect.y() + rect.height();
int g_x = (int)ceil(r.x()); int g_x = (int)ceil(rect.x());
while (g_x % xGrid) ++ g_x; while (g_x % xGrid) ++ g_x;
int g_y = (int)ceil(r.y()); int g_y = (int)ceil(rect.y());
while (g_y % yGrid) ++ g_y; while (g_y % yGrid) ++ g_y;
QPolygon points; QPolygon points;