mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Limit variable scope
This commit is contained in:
parent
f259263a7b
commit
90593ed92c
11 changed files with 21 additions and 23 deletions
|
|
@ -47,13 +47,14 @@ int TrafficGraphWidget::getGraphRangeMins() const
|
|||
|
||||
void TrafficGraphWidget::paintPath(QPainterPath &path, QQueue<float> &samples)
|
||||
{
|
||||
int h = height() - YMARGIN * 2, w = width() - XMARGIN * 2;
|
||||
int sampleCount = samples.size(), x = XMARGIN + w, y;
|
||||
int sampleCount = samples.size();
|
||||
if(sampleCount > 0) {
|
||||
int h = height() - YMARGIN * 2, w = width() - XMARGIN * 2;
|
||||
int x = XMARGIN + w;
|
||||
path.moveTo(x, YMARGIN + h);
|
||||
for(int i = 0; i < sampleCount; ++i) {
|
||||
x = XMARGIN + w - w * i / DESIRED_SAMPLES;
|
||||
y = YMARGIN + h - (int)(h * samples.at(i) / fMax);
|
||||
int y = YMARGIN + h - (int)(h * samples.at(i) / fMax);
|
||||
path.lineTo(x, y);
|
||||
}
|
||||
path.lineTo(x, YMARGIN + h);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue