mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
ncplot: fix top row calculations #642
This commit is contained in:
parent
ebcba82d4b
commit
cce55f1d4e
@ -138,9 +138,13 @@ class ncppplot {
|
||||
for(int y = 0 ; y < dimy ; ++y){
|
||||
char buf[PREFIXSTRLEN + 1];
|
||||
if(exponentiali){
|
||||
ncmetric(pow(interval, y * states + (states - 1)) * 100, 100, buf, 0, 1000, '\0');
|
||||
if(y == dimy - 1){ // we cheat on the top row to exactly match maxy
|
||||
ncmetric(maxy * 100, 100, buf, 0, 1000, '\0');
|
||||
}else{
|
||||
ncmetric(interval * states * (y + 1) * 100, 100, buf, 0, 1000, '\0');
|
||||
ncmetric(pow(interval, (y + 1) * states) * 100, 100, buf, 0, 1000, '\0');
|
||||
}
|
||||
}else{
|
||||
ncmetric((maxy - interval * states * (dimy - y - 1)) * 100, 100, buf, 0, 1000, '\0');
|
||||
}
|
||||
ncplane_printf_yx(ncp, dimy - y - 1, 0, "%*s", PREFIXCOLUMNS, buf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user