Opened 19 years ago

Closed 18 years ago

Last modified 18 years ago

#1494 closed defect (fixed)

shapeObj.draw & rectObj.draw use incorrect style to draw

Reported by: szekerest Owned by: sdlime
Priority: normal Milestone:
Component: MapScript-SWIG Version: unspecified
Severity: major Keywords:
Cc: sgillies@…

Description

shapeObj.draw and rectObj.draw always draw using a style with index = 1 even 
if the class has only one style (with index = 0). In the latter case 
msDrawShape uses uninitialized style to draw.

To fix this issue shape.i (line 85) should be modifyed to

return msDrawShape(map, layer, self, image, -1);

and rect.i (line 66) should be modifyed to

msDrawShape(map, layer, &shape, image, -1);

respectively.


Tamas Szekeres

Change History (8)

comment:1 by szekerest, 19 years ago

Cc: steve.lime@… added

comment:2 by szekerest, 19 years ago

Owner: changed from sgillies@… to sdlime
Reassigned as for #1491

comment:3 by sgillies@…, 19 years ago

Cc: sgillies@… added
Tamas, the class index is carried into msDrawShape by the shapeObj:

    shape.classindex = 2
    shape.draw(map, layer, image)

Do I misunderstand you?

comment:4 by szekerest, 19 years ago

Sean,

For shapeObj.draw the shape.i contains the followings:
 
int draw(mapObj *map, layerObj *layer, imageObj *image) {
        return msDrawShape(map, layer, self, image, MS_TRUE);
    }

There is a confusion with the 5. parameter of msDrawShape which nomally 
contains the index if the style. It should be -1 to draw all the styles. This 
applies to rectObj.draw as well.

Tamas

comment:5 by sdlime, 19 years ago

Good catch. I have made the change and committed to CVS...

Steve

comment:6 by sdlime, 18 years ago

Resolution: fixed
Status: newclosed
Tamas: Can you confirm this one?

Steve

comment:7 by szekerest, 18 years ago

Steve

This change works properly. You can close this bug.


For additional comments see:

http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1466

Tamas Szekeres

comment:8 by sdlime, 18 years ago

Marking as closed.
Note: See TracTickets for help on using tickets.