mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 16:50:53 +01:00
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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user