/[omni_gantt]/db2gantt.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /db2gantt.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by dpavlin, Fri Sep 13 18:35:50 2002 UTC revision 1.12 by dpavlin, Fri Sep 13 19:06:46 2002 UTC
# Line 112  sub mknav { Line 112  sub mknav {
112          return "<a href=\"".$q->url(-relative=>1)."?from_t=${f}&to_t=${t}\">$ch</a>";          return "<a href=\"".$q->url(-relative=>1)."?from_t=${f}&to_t=${t}\">$ch</a>";
113  }  }
114    
115  print "<table>";  print "<table cellspacing=0 cellpadding=0>";
116  print "<tr bgcolor=#e0e0e0><td>Specification</td><td align=left>";  print "<tr bgcolor=#e0e0e0><td>Specification</td><td align=left>";
117  print mknav(($from_t-$int_t),$to_t,'<small>&lt;&lt;</small>'),$from;  print mknav(($from_t-$int_t),$to_t,'<small>&lt;&lt;</small>'),$from;
118  print mknav(($from_t+$int_t),$to_t,'<small>&gt;&gt;</small>') if ($from_t+$int_t < $to_t);  print mknav(($from_t+$int_t),$to_t,'<small>&gt;&gt;</small>') if ($from_t+$int_t < $to_t);
# Line 136  sub hour_grid { Line 136  sub hour_grid {
136    
137  hour_grid();  hour_grid();
138    
139  my $fix_d = 0;  # used to fix graph len  my $fix_d = 0;  # used to fix graph len (in pixels)
140    my $fix_s = 0;  # used to collect round errors of size
141    
142  sub bar {  sub bar {
143          my $l = shift @_;          my $l = shift @_;
# Line 164  sub color_bar { Line 165  sub color_bar {
165          my $col = shift @_ || '240,240,240';    # default color (filler)          my $col = shift @_ || '240,240,240';    # default color (filler)
166          my $alt = shift @_ || undef;          my $alt = shift @_ || undef;
167    
168          my $size = int($l / ($len_t / $width));          my $size = $l / ($len_t / $width);
169          if ($size < $min_l) {          $fix_s += $size - int($size);
170            $size=int($size);
171            if ($fix_s > 1) {
172                    $fix_s -= 1;
173                    $size++;
174            }
175    
176            if ($alt && $size < $min_l) {
177                  $fix_d += ($min_l - $size);                  $fix_d += ($min_l - $size);
178                  print STDERR "fix_d: $fix_d\n" if ($debug);                  print STDERR "fix_d: $fix_d\n" if ($debug);
179                  $size = $min_l;                  $size = $min_l;

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.26