Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
f8931bc1
Commit
f8931bc1
authored
Dec 24, 2015
by
Explorer09
Browse files
Minor change. Write 0.0 in some parts in GraphMeterMode_draw
parent
e2fde830
Changes
1
Hide whitespace changes
Inline
Side-by-side
Meter.c
View file @
f8931bc1
...
...
@@ -425,7 +425,7 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
currentItemSums
[
0
]
=
this
->
values
[
0
];
for
(
int
i
=
0
;
i
<
items
;
i
++
)
{
prevItemSums
[
i
]
=
currentItemSums
[
i
];
currentItemSums
[
i
]
=
((
i
>
0
)
?
currentItemSums
[
i
-
1
]
:
0
)
+
this
->
values
[
i
];
currentItemSums
[
i
]
=
((
i
>
0
)
?
currentItemSums
[
i
-
1
]
:
0
.
0
)
+
this
->
values
[
i
];
}
data
->
values
[
nValues
-
1
]
=
currentItemSums
[
items
-
1
]
/
this
->
total
;
...
...
@@ -439,8 +439,8 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
double
lowerBound
=
this
->
total
*
(
GRAPH_HEIGHT
-
1
-
line
)
/
GRAPH_HEIGHT
;
area
=
MAX
(
lowerBound
,
MIN
(
currentItemSums
[
i
],
upperBound
))
+
MAX
(
lowerBound
,
MIN
(
prevItemSums
[
i
],
upperBound
));
area
-=
MAX
(
lowerBound
,
MIN
(((
i
>
0
)
?
currentItemSums
[
i
-
1
]
:
0
),
upperBound
))
+
MAX
(
lowerBound
,
MIN
(((
i
>
0
)
?
prevItemSums
[
i
-
1
]
:
0
),
upperBound
));
area
-=
MAX
(
lowerBound
,
MIN
(((
i
>
0
)
?
currentItemSums
[
i
-
1
]
:
0
.
0
),
upperBound
))
+
MAX
(
lowerBound
,
MIN
(((
i
>
0
)
?
prevItemSums
[
i
-
1
]
:
0
.
0
),
upperBound
));
if
(
area
>
maxArea
)
{
maxArea
=
area
;
dominantColor
=
CRT_colors
[
Meter_attributes
(
this
)[
i
]];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment