mirror of https://github.com/xzeldon/htop.git
Minor typo and comment clarification
This commit is contained in:
parent
7e7a53c415
commit
5fa1c7040d
4
Meter.c
4
Meter.c
|
@ -199,14 +199,14 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// The text in the bar is right aligned;
|
// The text in the bar is right aligned;
|
||||||
// Pad with maximal spaces and then calculate needed staring position offset
|
// Pad with maximal spaces and then calculate needed starting position offset
|
||||||
RichString_begin(bar);
|
RichString_begin(bar);
|
||||||
RichString_appendChr(&bar, ' ', w);
|
RichString_appendChr(&bar, ' ', w);
|
||||||
RichString_appendWide(&bar, 0, buffer);
|
RichString_appendWide(&bar, 0, buffer);
|
||||||
int startPos = RichString_sizeVal(bar) - w;
|
int startPos = RichString_sizeVal(bar) - w;
|
||||||
if (startPos > w) {
|
if (startPos > w) {
|
||||||
// Text is too large for bar
|
// Text is too large for bar
|
||||||
// Truncate too long bar meter text at a space character
|
// Truncate meter text at a space character
|
||||||
for (int pos = 2 * w; pos > w; pos--) {
|
for (int pos = 2 * w; pos > w; pos--) {
|
||||||
if (RichString_getCharVal(bar, pos) == ' ') {
|
if (RichString_getCharVal(bar, pos) == ' ') {
|
||||||
while (pos > w && RichString_getCharVal(bar, pos - 1) == ' ')
|
while (pos > w && RichString_getCharVal(bar, pos - 1) == ' ')
|
||||||
|
|
Loading…
Reference in New Issue