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
360ffbb6
Commit
360ffbb6
authored
Dec 24, 2015
by
Explorer09
Browse files
Fix graph coloring algorithm error
parent
5c18866e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Meter.c
View file @
360ffbb6
...
...
@@ -437,10 +437,8 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
double
area
;
area
=
MIN
(
currentItemSums
[
i
],
this
->
total
*
(
GRAPH_HEIGHT
-
line
)
/
GRAPH_HEIGHT
)
+
MIN
(
prevItemSums
[
i
],
this
->
total
*
(
GRAPH_HEIGHT
-
line
)
/
GRAPH_HEIGHT
);
if
(
i
>
0
)
{
area
-=
MAX
(
currentItemSums
[
i
-
1
],
this
->
total
*
(
GRAPH_HEIGHT
-
1
-
line
)
/
GRAPH_HEIGHT
)
+
MAX
(
prevItemSums
[
i
-
1
],
this
->
total
*
(
GRAPH_HEIGHT
-
1
-
line
)
/
GRAPH_HEIGHT
);
}
area
-=
MAX
(((
i
>
0
)
?
currentItemSums
[
i
-
1
]
:
0
),
this
->
total
*
(
GRAPH_HEIGHT
-
1
-
line
)
/
GRAPH_HEIGHT
)
+
MAX
(((
i
>
0
)
?
currentItemSums
[
i
-
1
]
:
0
),
this
->
total
*
(
GRAPH_HEIGHT
-
1
-
line
)
/
GRAPH_HEIGHT
);
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