- Quick hack to the code of SimulationWidget to draw the
interval [a, b) of History (where b is the front), instead than (a, b]. - TODO: SimulationWidget would sincerely benefit from some more comments in the code git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1027 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
22dded7243
commit
c62734ef59
|
@ -223,7 +223,7 @@ SimulationWidget::draw_grid(cairo_t* ctx)
|
|||
// useful constants
|
||||
const History& hist = _simulation->get_history();
|
||||
|
||||
const unsigned int hist_front = hist.get_front();
|
||||
const unsigned int hist_front = hist.get_front() == 0 ? 0 : hist.get_front() - 1;
|
||||
const double top_margin = _yu_top_margin * _y_unit;
|
||||
// const double left_margin = _x_unit;
|
||||
const double left_graph_margin = _xu_left_graph_margin * _x_unit;
|
||||
|
@ -302,7 +302,7 @@ SimulationWidget::draw_bars(cairo_t* ctx)
|
|||
|
||||
// useful constants
|
||||
const History& hist = _simulation->get_history();
|
||||
const unsigned int hist_front = hist.get_front();
|
||||
unsigned int hist_front = hist.get_front();
|
||||
const double top_margin = _yu_top_margin * _y_unit;
|
||||
// const double left_margin = _x_unit;
|
||||
const double left_graph_margin = _xu_left_graph_margin * _x_unit;
|
||||
|
@ -328,6 +328,13 @@ SimulationWidget::draw_bars(cairo_t* ctx)
|
|||
from_time = 1;
|
||||
}
|
||||
|
||||
// We draw the interval [0, front)
|
||||
// so if front <= 1, we've nothing to draw
|
||||
if(hist_front <= 1)
|
||||
return;
|
||||
else
|
||||
hist_front--;
|
||||
|
||||
#ifndef NDEBUG
|
||||
std::cout << " SimulationWidget::draw_bars from:" << from_time << " to:" << hist_front << std::endl;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue