| 393 | } |
| 394 | |
| 395 | int msDrawLineSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p, |
| 396 | styleObj *style, double scalefactor) |
| 397 | { |
| 398 | if (image) |
| 399 | { |
| 400 | if (MS_RENDERER_PLUGIN(image->format)) { |
| 401 | rendererVTableObj *renderer = image->format->vtable; |
| 402 | symbolObj *symbol; |
| 403 | shapeObj *offsetLine = p; |
| 404 | int i; |
| 405 | double width; |
| 406 | |
| 407 | if (p->numlines == 0) |
| 408 | return MS_SUCCESS; |
| 409 | |
| 410 | if (style->symbol >= symbolset->numsymbols || style->symbol < 0) |
| 411 | return MS_SUCCESS; /* no such symbol, 0 is OK */ |
| 412 | |
| 413 | symbol = symbolset->symbol[style->symbol]; |
| 414 | /* store a reference to the renderer to be used for freeing */ |
| 415 | symbol->renderer = renderer; |
| 416 | |
| 417 | width = style->width * scalefactor; |
| 418 | width = MS_MIN(width,style->maxwidth); |
| 419 | width = MS_MAX(width,style->minwidth); |
| 420 | |
| 421 | if(style->offsety==-99) { |
| 422 | offsetLine = msOffsetPolyline(p,style->offsetx * width/style->width,-99); |
| 423 | } else if(style->offsetx!=0 || style->offsety!=0) { |
| 424 | offsetLine = msOffsetPolyline(p, style->offsetx * width/style->width, |
| 425 | style->offsety * width/style->width); |
| 426 | } |
| 427 | if(style->symbol == 0 || (symbol->type==MS_SYMBOL_SIMPLE)) { |
| 428 | strokeStyleObj s; |
| 429 | s.linecap = style->linecap; |
| 430 | s.linejoin = style->linejoin; |
| 431 | s.linejoinmaxsize = style->linejoinmaxsize; |
| 432 | s.width = width; |
| 433 | s.patternlength = style->patternlength; |
| 434 | for(i=0; i<s.patternlength; i++) |
| 435 | s.pattern[i] = style->pattern[i]*s.width/style->width; |
| 436 | |
| 437 | if(MS_VALID_COLOR(style->color)) |
| 438 | s.color = &style->color; |
| 439 | else if(MS_VALID_COLOR(style->outlinecolor)) |
| 440 | s.color = &style->outlinecolor; |
| 441 | else { |
| 442 | /* msSetError(MS_MISCERR,"no color defined for line styling","msDrawLineSymbol()"); |
| 443 | * not really an error */ |
| 444 | return MS_SUCCESS; |
| 445 | } |
| 446 | renderer->renderLine(image,offsetLine,&s); |
| 447 | } |
| 448 | else { |
| 449 | symbolStyleObj s; |
| 450 | switch (symbol->type) { |
| 451 | case (MS_SYMBOL_TRUETYPE): { |
| 452 | if(!symbol->full_font_path) |
no test coverage detected