iphone quartz drawing 2 lines on top of each other causes worm effect -
i'm using quartz-2d iphone display route on map. route colored according temperature. because streets colored yellow, using thicker black line under route line create border effect, yellow parts of route spottable on yellow streets. but, if black line thick route line, whole route looks worm (very ugly). tought because drawing lines waypoint waypoint, instead using last waypoint next starting waypoint. way if there couple of waypoints missing, route still have no cuts.
what need display both lines without worm effect?
-(void) drawrect:(cgrect) rect { csrouteannotation* routeannotation = (csrouteannotation*)self.routeview.annotation; // draw our lines if we're not int moddie of transition , // acutally have points draw. if(!self.hidden && nil != routeannotation.points && routeannotation.points.count > 0) { cgcontextref context = uigraphicsgetcurrentcontext(); waypoint* fromwaypoint = [[waypoint alloc] initwithdictionary:[routeannotation.points objectatindex:0]]; waypoint* towaypoint; for(int idx = 1; idx < routeannotation.points.count; idx++) { towaypoint = [[waypoint alloc] initwithdictionary:[routeannotation.points objectatindex:idx]]; cllocation* fromlocation = [fromwaypoint getlocation]; cgpoint frompoint = [self.routeview.mapview convertcoordinate:fromlocation.coordinate topointtoview:self]; cllocation* tolocation = [towaypoint getlocation]; cgpoint topoint = [self.routeview.mapview convertcoordinate:tolocation.coordinate topointtoview:self]; routeannotation.linecolor = [fromwaypoint.weather gettemperaturecolor]; cgcontextbeginpath(context); cgcontextsetlinewidth(context, 3.0); cgcontextsetstrokecolorwithcolor(context, [uicolor blackcolor].cgcolor); cgcontextmovetopoint(context, frompoint.x, frompoint.y); cgcontextaddlinetopoint(context, topoint.x, topoint.y); cgcontextstrokepath(context); cgcontextclosepath(context); cgcontextbeginpath(context); cgcontextsetlinewidth(context, 3.0); cgcontextsetstrokecolorwithcolor(context, routeannotation.linecolor.cgcolor); cgcontextmovetopoint(context, frompoint.x, frompoint.y); cgcontextaddlinetopoint(context, topoint.x, topoint.y); cgcontextstrokepath(context); cgcontextclosepath(context); fromwaypoint = towaypoint; } [fromwaypoint release]; [towaypoint release]; } } also,
<error>: cgcontextclosepath: no current point. error, think bullshit.
please hint me! :)
instead of drawing 2 lines, draw 1 , use the shadows ability?
Comments
Post a Comment