Permalink
Browse files

fixed timeline drawing (comments and debug messages removed)

  • Loading branch information...
1 parent 7184492 commit 6540e9560302c757b0fdecdf41304b706724c758 Torsten Schlumm committed May 2, 2012
Showing with 0 additions and 10 deletions.
  1. +0 −10 src/NED/NETimelineView.m
View
10 src/NED/NETimelineView.m
@@ -234,17 +234,11 @@ -(void)drawCoordinateSystem:(NSRect)rect
-(void)drawEventBars:(NSRect)rect
{
- // NSLog(@"drawEventBars called with NSRect {{%g, %g}, {%g, %g}}", NSMinX(rect), NSMinY(rect), NSWidth(rect), NSHeight(rect));
#pragma unused(rect)
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
NSUInteger mediaObjNr = 0;
- NEStimEvent* _firstDynamicEvent = [[mTimetable eventsToHappenForMediaObjectID:@"NEG2457DYN"] objectAtIndex:0];
- NSLog(@"[_firstDynamicEvent time] = %lu", [_firstDynamicEvent time]);
- NSLog(@"[_firstDynamicEvent origin.x] = %f", ([_firstDynamicEvent time] / 100.0) + FRAME_PADDING);
- NSLog(@"[_firstDynamicEvent origin.x (corrected)] = %f", ((CGFloat)[_firstDynamicEvent time] / (CGFloat)[mTimetable duration]) * ([self frame].size.width - (2.0 * FRAME_PADDING)) + FRAME_PADDING);
-
for (NSString* mediaObjID in [mTimetable getAllMediaObjectIDs]) {
NSArray* happenedEvents = [mTimetable happenedEventsForMediaObjectID:mediaObjID];
NSArray* eventsToHappen = [mTimetable eventsToHappenForMediaObjectID:mediaObjID];
@@ -255,7 +249,6 @@ -(void)drawEventBars:(NSRect)rect
for (NEStimEvent* event in happenedEvents) {
NSRect eventRect;
-// eventRect.origin.x = ([event time] / 100.0) + FRAME_PADDING;
eventRect.origin.x = ((CGFloat)[event time] / (CGFloat)[mTimetable duration]) * ([self frame].size.width - (2.0 * FRAME_PADDING)) + FRAME_PADDING;
eventRect.origin.y = (mediaObjNr * EVENT_BAR_HEIGHT) + FRAME_PADDING;
eventRect.size.height = EVENT_BAR_HEIGHT;
@@ -265,7 +258,6 @@ -(void)drawEventBars:(NSRect)rect
}
for (NEStimEvent* event in eventsToHappen) {
NSRect eventRect;
-// eventRect.origin.x = ([event time] / 100.0) + FRAME_PADDING;
eventRect.origin.x = ((CGFloat)[event time] / (CGFloat)[mTimetable duration]) * ([self frame].size.width - (2.0 * FRAME_PADDING)) + FRAME_PADDING;
eventRect.origin.y = (mediaObjNr * EVENT_BAR_HEIGHT) + FRAME_PADDING;
eventRect.size.height = EVENT_BAR_HEIGHT;
@@ -325,8 +317,6 @@ -(void)drawCurrentTimeLine:(NSRect)rect
#pragma unused(rect)
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
- NSLog(@"[drawCurrentTimeLine] mCurrentTime = %lu", mCurrentTime);
- NSLog(@"[drawCurrentTimeLine] timeCursorPosition = %f", ((CGFloat)mCurrentTime / (CGFloat)[mTimetable duration]) * ([self frame].size.width - (2.0 * FRAME_PADDING)) + FRAME_PADDING);
CGContextSetRGBStrokeColor(context, 1.0, 0.0, 0.0, 1.0);
CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1.0);
CGFloat timeCursorPosition = ((CGFloat)mCurrentTime / (CGFloat)[mTimetable duration]) * ([self frame].size.width - (2.0 * FRAME_PADDING));

0 comments on commit 6540e95

Please sign in to comment.