Opened 16 years ago

Closed 16 years ago

#2382 closed enhancement (fixed)

legend does not support multiline labels

Reported by: tbonfort Owned by: tbonfort
Priority: normal Milestone: 5.2 release
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc: yjacolin, sdlime, dmorissette

Description

when rendering text labels for a legend, the labelObj's WRAP parameter isn't taken into account.

this is probably because the legend labelling function doesn't really support linebreaks (when they are present, all legend items are resized to accomodate a multiline label, and the baseline of the rendered text is false).

two steps to fix this:

  • make the legend rendering function aware of multiline labels (which means using the heights[] array instead of discarding its data)
  • add a call to replace the label's wrap parameter with \n

Steve, Daniel, attached is a patch to fix both these issues, does this warrant more than this bugreport before I commit it?

Attachments (1)

legendmultiline.patch (6.3 KB ) - added by tbonfort 16 years ago.
patch to enable multiline legend labels

Download all attachments as: .zip

Change History (4)

by tbonfort, 16 years ago

Attachment: legendmultiline.patch added

patch to enable multiline legend labels

comment:1 by sdlime, 16 years ago

Milestone: 5.2 release
Type: defectenhancement

Thomas: I don't think a feature addition like this requires an RFC, the bug is sufficient. Patch looks good so go ahead.

Steve

comment:2 by tbonfort, 16 years ago

commited in r7005 I rewrote the layer/class looping to avoid having to test for scale dependant visibility over and over again. Even though valgrind doesn't show anything special, I'm leaving open for the time being as it uses a linked list that could go through some more testing.

comment:3 by tbonfort, 16 years ago

Resolution: fixed
Status: newclosed

closing

Note: See TracTickets for help on using tickets.