fixing drawing lines
This commit is contained in:
parent
2ba6957f93
commit
b9d0a0a272
@ -66,7 +66,11 @@ void RenderArea::paintEvent(QPaintEvent* event)
|
|||||||
|
|
||||||
painter.drawRect(this->rect());
|
painter.drawRect(this->rect());
|
||||||
|
|
||||||
QPoint center{this->rect().center()};
|
QPointF prevPoint{Compute(0)};
|
||||||
|
QPoint center{this->rect().center()},prevPixel;
|
||||||
|
prevPixel.setX(prevPoint.x() * mScale + center.x());
|
||||||
|
prevPixel.setY(prevPoint.y() * mScale + center.y());
|
||||||
|
|
||||||
double step{ mIntervalLenght / mStepCount };
|
double step{ mIntervalLenght / mStepCount };
|
||||||
|
|
||||||
for(float t = 0; t < mIntervalLenght; t += step){
|
for(float t = 0; t < mIntervalLenght; t += step){
|
||||||
@ -76,7 +80,9 @@ void RenderArea::paintEvent(QPaintEvent* event)
|
|||||||
pixel.setX(point.x() * mScale + center.x());
|
pixel.setX(point.x() * mScale + center.x());
|
||||||
pixel.setY(point.y() * mScale + center.y());
|
pixel.setY(point.y() * mScale + center.y());
|
||||||
|
|
||||||
painter.drawPoint(pixel);
|
painter.drawLine(pixel, prevPixel);
|
||||||
|
|
||||||
|
prevPixel=pixel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user