Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1607 closed defect (fixed)

Labels in a Legend Image are shifted downward, the shift is worse when more layers are turned on.

Reported by: kenlord@… Owned by: sdlime
Priority: high Milestone:
Component: MapServer CGI Version: 4.8
Severity: normal Keywords:
Cc:

Description

The labels next to the symbol graphics within a Legend Image (not created by 
an HTML legend template) are shifted down relative to the symbol graphics.

The more layers are turned on, the further down the labels are shifted.

I've tried different fonts and various legend settings, but the shift 
consistantly occurs.  Using the OFFSET parameter to correct the problem only 
helps slightly because the amount of downward shift varies with the number of 
layers turned on.  

The problem does not occur using MapServer 4.6 on the same server with the 
same fonts and legend settings.

The following has been suggested by Steve Lime:

"I do think there is a bug present. Probably a counter not being reset properly
as layers are looped through. Please file a bug with a couple of image samples
that show the progressive shift downward.

Steve"

Examples can be seen at the following links, the first has few layers turned 
on, no shift is apparent.  The second has many layers turned on, with the 
shift severe enough to almost align the labels with the next symbol down from 
where they should be.

http://www.bgcengineering.info/dnv/images/LegendShift1.jpg

http://www.bgcengineering.info/dnv/images/LegendShift2.jpg

I'm using MapServer 4.8b2 CGI, Windows Server 2003

My legend settings in my mapfile are:

LEGEND
  STATUS ON
  KEYSIZE 20 12  
  KEYSPACING 3 5
  IMAGECOLOR 230 230 230
  LABEL
      COLOR 0 0 0
      SIZE 10
      FONT "Arial"
      TYPE truetype
  END
END

Cheers,
Ken Lord
Vancouver BC

Change History (4)

comment:1 by sdlime, 18 years ago

Status: newassigned
Ok, I think I found the problem (although I don't know quite how to fix yet).
Bug 1443 tried to fix a baseline computation issue with truetype fonts. As a
result the bounding box reported by msGetLabelSize changed from the time the
legend code was written. No big deal for when drawing a label at a time but
there seems to be some cummulative problem introduced in the case of legends.
Working on it...

Steve

comment:2 by sdlime, 18 years ago

Definitely a problem with the bug 1449 (not 1443, sorry) fix. That fix alters
the label offsetx and offsety values. So repeated calls with the same label
object creates a cummulative offset. Whoops.

Looking into rolling back that fix.

Steve

comment:3 by sdlime, 18 years ago

Resolution: fixed
Status: assignedclosed
Fixed in 4.8 and in CVS. See bug 1449 for solution.

Steve

comment:4 by kenlord@…, 18 years ago

Thanks for your efforts Steve,

I'll try it out as soon as the next compiled windows binary is available.

Cheers,
Ken

Note: See TracTickets for help on using tickets.