Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369396 - drawEventsDownToTheHourAndMinute calculates wrong start and length of the events
Summary: drawEventsDownToTheHourAndMinute calculates wrong start and length of the events
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Emil Crumhorn CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-23 10:14 EST by Jürgen Reichl CLA
Modified: 2021-07-05 11:40 EDT (History)
3 users (show)

See Also:


Attachments
quickfix (2.32 KB, patch)
2012-01-23 10:15 EST, Jürgen Reichl CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jürgen Reichl CLA 2012-01-23 10:14:03 EST
Build Identifier: M20110210-1200

if drawEventsDownToTheHourAndMinute is true it calculates the wrong start and the wrong length of the GantEvent!

Reproducible: Always
Comment 1 Jürgen Reichl CLA 2012-01-23 10:15:53 EST
Created attachment 209918 [details]
quickfix

solution without minutes.
Comment 2 Michel Schaffers CLA 2012-02-25 04:56:45 EST
Made the same observation, draw to the minute feature does not calculate correct ends of an event.

fix the wrong beginning:
public int getStartingXFor(final Calendar date) {
...
            final float widthonehour = getDayWidth()/24.0f;
            final int hours = date.get(Calendar.HOUR_OF_DAY);
            extra = (int) (widthonehour * hours);
...

fix the wrong length:
private int getXLengthForEvent(final GanttEvent event) {
...
        if (_drawToMinute ) 
        {
            int minutesbetweenstartandend = DateHelper.minutesBetween(event.getActualStartDate().getTime(), 
												                    event.getActualEndDate().getTime(),
												                    false,  // assume same date
												                    false); // assume same hour
            return minutesbetweenstartandend * getDayWidth() / 24 / 60;
        }
...
Comment 3 Tilman Reinhardt CLA 2012-03-01 08:50:09 EST
Actually i cannot reproduce the wrong behavior of drawEventsDownToTheHourAndMinute.

But i made the same observation as Michel and opened a new bug 372970 for this!
Comment 4 Wim Jongman CLA 2019-12-12 15:58:03 EST
This bug does not have a target milestone assigned and is automatically closed as part of the 2.3.0 release cleanup.

It could be that this bug is accidentally closed for which we apologize.

If this bug is still relevant, please re-open and set a target milestone.