From 28bd934c50681c1129913299e125a6f7880cee62 Mon Sep 17 00:00:00 2001 From: paolo Date: Fri, 15 Sep 2006 23:29:52 +0000 Subject: [PATCH] - bugfix drawing holt_graph git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1182 3ecf2c5c-341e-0410-92b4-d18e462d057c --- src/holt_widget.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/holt_widget.cc b/src/holt_widget.cc index a5a20cc..980acfb 100644 --- a/src/holt_widget.cc +++ b/src/holt_widget.cc @@ -335,7 +335,7 @@ void HoltRequest::arrow(cairo_t *cr, Vec2 first, Vec2 second) // some calculation to draw arrowpoint... // take a short line parallel to main line Vec2 arrowside = second-first; - arrowside *= 15.0*line_width/std::abs(arrowside); + arrowside *= 5.0*line_width/std::abs(arrowside); // make a rotation component Vec2 deviation(5.0, 1.0); deviation /= std::abs(deviation); // make left and right sides rotating that first short line @@ -478,6 +478,13 @@ HoltWidget::arrange() int sx = _draw_w; // get_width(); int sy = _draw_h; // get_height(); int nelem = _holt_resources.size()+_holt_schedulables.size(); + // take minimum between x and y + /* + if(sx<=sy) + inc = Vec2((sx/2-2*_radius), 0); + else + inc = Vec2((sy/2-2*_radius), 0); + */ if(nelem>1) { // take minimum between x and y @@ -492,13 +499,15 @@ HoltWidget::arrange() inc = Vec2(0, 0); } + // calc rotation angle if(nelem>0) mul = Vec2(cos(2*M_PI/(double)nelem), sin(2*M_PI/(double)nelem)); else mul = Vec2(0,0); - cen = Vec2(2*_radius+inc.real(), 2*_radius+inc.real()); + // cen = Vec2(2*_radius+inc.real(), 2*_radius+inc.real()); + cen = Vec2(2*_radius+std::abs(inc), 2*_radius+std::abs(inc)); pos = inc + cen; }