From: Christian G. [M. Mitch] <mas...@us...> - 2002-01-19 10:56:08
|
Update of /cvsroot/jprojecttimer/jprojecttimer/de/cgarbs/apps/jprojecttimer In directory usw-pr-cvs1:/tmp/cvs-serv20682/de/cgarbs/apps/jprojecttimer Modified Files: GanttDiagram.java Log Message: Fixed the div by zero bug again (bug was revived by the printing patch) Index: GanttDiagram.java =================================================================== RCS file: /cvsroot/jprojecttimer/jprojecttimer/de/cgarbs/apps/jprojecttimer/GanttDiagram.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GanttDiagram.java 2002/01/18 21:22:10 1.3 --- GanttDiagram.java 2002/01/19 10:56:05 1.4 *************** *** 52,55 **** --- 52,59 ---- tasks.recalculate(); int cols = tasks.projectEnd(); + if (cols == 0) { + // avoid div by zero + cols = 1; + } // Header *************** *** 63,66 **** --- 67,75 ---- } // Tasks + int size = tasks.size(); + if (size == 0) { + // avoid div by zero + size = 1; + } for (int row = 0; row < tasks.size(); row++) { ((Task) tasks.elementAt(row)).paint(g, |