Opened 13 years ago

Closed 13 years ago

#3787 closed defect (fixed)

wrong dash pattern

Reported by: zanollim Owned by: sdlime
Priority: normal Milestone: 6.0 release
Component: MapServer C Library Version: 6.0
Severity: normal Keywords:
Cc: tbonfort

Description (last modified by tbonfort)

I'm not able to reproduce this pattern [mapserver-6.0.0-beta3]:

==== == ==== == ==== ==

here the map code

STYLE
  COLOR 0 0 0
  LINECAP square
  PATTERN 4 2 2 2 END
END

Is this a bug? Thanks, michele

Attachments (3)

dash_dot.png (4.1 KB ) - added by zanollim 13 years ago.
pattern_4_3_1_3.png (4.4 KB ) - added by zanollim 13 years ago.
pattern 4 3 1 3 (crazy behavior)
pattern_12_6_6_6.png (4.2 KB ) - added by zanollim 13 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 by sdlime, 13 years ago

Cc: tbonfort added

comment:2 by tbonfort, 13 years ago

Description: modified (diff)

I'm guessing that the square linecap is eating into the blank space left between the dashes. Try with linecap butt, or increasing the spacing, eg:

4 3 2 3

comment:3 by zanollim, 13 years ago

Thanks tbonfort,

it seems that 4 2 1 2 is the best solution for me.
But in the map the value 2 [num off] is shorter than value 1 [num on]
(see the screenshot attached) I think this is a wrong behavior

michele

by zanollim, 13 years ago

Attachment: dash_dot.png added

comment:4 by tbonfort, 13 years ago

with LINECAP square I don't think it is the wrong behavior

comment:5 by zanollim, 13 years ago

but my screenshot refers exactly to this code

STYLE
  WIDTH 3
  OUTLINECOLOR 160 0 160
  LINECAP butt
  PATTERN 4 2 1 2 END
END

by zanollim, 13 years ago

Attachment: pattern_4_3_1_3.png added

pattern 4 3 1 3 (crazy behavior)

comment:6 by tbonfort, 13 years ago

Resolution: wontfix
Status: newclosed

Ok,

there might be some glitches in how different renderers interpret the line caps. Given that there's a workaround (by augmenting the white space), and that the implementation of a fix would involve getting into the code of each renderer (agg,cairo,gd), I don't think this this will get investigated more.

comment:7 by zanollim, 13 years ago

As you can see in the pattern_4_3_1_3 attachment, augmenting the white space returns a copletely different and wrong behavior.

comment:8 by tbonfort, 13 years ago

Note that the pattern, starting from beta3, is not scaled by the line width (as was the case beforehand). In that regard, it is usually not a good idea to have any value in your pattern that is smaller than the actual width of your line.

so, using width 3, do you get what you expect with

STYLE
  WIDTH 3
  OUTLINECOLOR 160 0 160
  LINECAP butt
  PATTERN 12 6 6 6 END
END

?

comment:9 by zanollim, 13 years ago

sorry tbonfort, but your style code (see pattern_12_6_6_6 attachment) is too far from the best solution for me (see the dash_dot attachment)

by zanollim, 13 years ago

Attachment: pattern_12_6_6_6.png added

comment:10 by tbonfort, 13 years ago

Resolution: wontfix
Status: closedreopened

thank you for pushing on this ;)

I looked in the code and there was a bug in the mapserver agg code. I'll commit the fix asap and let you try with trunk.

comment:11 by tbonfort, 13 years ago

committed in r11364.

please report back.

comment:12 by zanollim, 13 years ago

thank you for the very immediate support!!! I will try soon

comment:13 by zanollim, 13 years ago

My tests with mapserver-6.0.0-beta4 are OK! For me this ticket can be closed

comment:14 by tbonfort, 13 years ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.