ref: 92d5d58784130a456dec269ce0d876ba7ad89932
parent: 88faa807aaeae42ec058e6e09f29339df9773098
author: Jacob Moody <[email protected]>
date: Wed May 8 19:24:55 EDT 2024
flambe: pass correct name to initdraw()
--- a/sys/src/cmd/flambe.c
+++ b/sys/src/cmd/flambe.c
@@ -154,12 +154,6 @@
flushimage(display, 1);
}
-int
-getwidth(int i)
-{
- return ((double)data[i].time * Dx(screen->r)) / total;
-}
-
void
graph(int i, int x, int h)
{
@@ -168,7 +162,10 @@
if(i >= ndata)
sysfatal("corrupted profile data");
r.min = (Point){x, screen->r.max.y - rowh*h};
- r.max = (Point){x + getwidth(i), r.min.y + rowh};
+ r.max = (Point){
+ x + ((double)data[i].time * Dx(screen->r)) / total,
+ r.min.y + rowh
+ };
clicks[i] = r;
if(Dx(r) > 6){
draw(screen, r, colfor(h), nil, ZP);
@@ -246,7 +243,7 @@
data[i].time = t + data[0].time;
}
- if(initdraw(nil, nil, "profflame") < 0)
+ if(initdraw(nil, nil, "flambe") < 0)
sysfatal("initdraw: %r");
if((kctl = initkeyboard(nil)) == nil)
sysfatal("initkeyboard: %r");