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
d311e85b
Commit
d311e85b
authored
Feb 02, 2016
by
Hisham
Browse files
Avoid crash on huge screens.
Fix by @Explorer09 (see discussion on #355).
parent
c148907e
Changes
1
Show whitespace changes
Inline
Side-by-side
Meter.c
View file @
d311e85b
...
@@ -407,7 +407,12 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
...
@@ -407,7 +407,12 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
data
->
values
[
nValues
-
1
]
=
value
;
data
->
values
[
nValues
-
1
]
=
value
;
}
}
for
(
int
i
=
nValues
-
(
w
*
2
)
+
2
,
k
=
0
;
i
<
nValues
;
i
+=
2
,
k
++
)
{
int
i
=
nValues
-
(
w
*
2
)
+
2
,
k
=
0
;
if
(
i
<
0
)
{
k
=
-
i
/
2
;
i
=
0
;
}
for
(;
i
<
nValues
;
i
+=
2
,
k
++
)
{
int
pix
=
GraphMeterMode_pixPerRow
*
GRAPH_HEIGHT
;
int
pix
=
GraphMeterMode_pixPerRow
*
GRAPH_HEIGHT
;
int
v1
=
CLAMP
(
data
->
values
[
i
]
*
pix
,
1
,
pix
);
int
v1
=
CLAMP
(
data
->
values
[
i
]
*
pix
,
1
,
pix
);
int
v2
=
CLAMP
(
data
->
values
[
i
+
1
]
*
pix
,
1
,
pix
);
int
v2
=
CLAMP
(
data
->
values
[
i
+
1
]
*
pix
,
1
,
pix
);
...
...
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