5 #define MINSTACKHEIGHT 16
7 IntAutos::IntAutos(Track *track,
12 : Autos(track, color, default_, stack_number, stack_total)
15 this->max = 1; this->min = -1;
16 this->virtual_h = 100;
23 int IntAutos::slope_adjustment(int64_t ax, float slope)
28 int IntAutos::get_track_pixels(int zoom_track, int pixel, int ¢er_pixel, float &yscale)
30 if(zoom_track < MINSTACKHEIGHT)
32 center_pixel = pixel + zoom_track / 2;
33 yscale = -(float)zoom_track / (max - min) * .75;
36 if(zoom_track / stack_total < MINSTACKHEIGHT)
38 center_pixel = pixel + MINSTACKHEIGHT / 2 + (stack_number * MINSTACKHEIGHT % zoom_track) * zoom_track;
39 yscale = -(float)MINSTACKHEIGHT / (max - min) * .75;
43 center_pixel = pixel + (zoom_track / stack_total) / 2 + (zoom_track / stack_total) * stack_number;
44 yscale = -(float)(zoom_track / stack_total) / (max - min) * .75;
48 int IntAutos::draw_joining_line(BC_SubWindow *canvas, int vertical, int center_pixel, int x1, int y1, int x2, int y2)
51 canvas->draw_line(center_pixel - y1, x1, center_pixel - y1, x2);
53 canvas->draw_line(x1, center_pixel + y1, x2, center_pixel + y1);
58 canvas->draw_line(center_pixel - y1, x2, center_pixel - y2, x2);
60 canvas->draw_line(x2, center_pixel + y1, x2, center_pixel + y2);
65 Auto* IntAutos::add_auto(int64_t position, float value)
67 IntAuto* current = (IntAuto*)autoof(position);
70 insert_before(current, new_auto = new IntAuto(this));
72 new_auto->position = position;
73 new_auto->value = value;
79 Auto* IntAutos::append_auto()
81 return append(new IntAuto(this));
85 float IntAutos::fix_value(float value)
87 if(value >= 0) value = 1;
89 if(value < 0) value = -1;
93 int IntAutos::get_testy(float slope, int cursor_x, int ax, int ay)