Ticket #3434 (closed patch: fixed)

Opened 2 years ago

Last modified 2 years ago

new symbology line decoration with wrong orientation

Reported by: strk Owned by: wonder
Priority: major: does not work as expected Milestone: Version 1.7.0
Component: Symbology Version: Trunk
Keywords: Cc:
Platform Version: Platform: Debian
Must Fix for Release: No Awaiting user input: no

Description

I'm showing 2 lines with new symbology and line decoration. Both lines are horizontal 2 points segments. The one above goes right-to-left. The one below goes left-to-right.

I would expect the line decoration (kind of an arrow head) to go in the direction of the line, but this is not happening for the right-to-left one.

Here's a snapshot:  http://strk.keybit.net/tmp/qgis_new_symbology_line_decoration.png

For reference, WKT of the two lines: 10: LINESTRING(35 14,21 14) 13: LINESTRING(21 6,35 6)

This is qgis r15056

Attachments

0001-Fix-math-used-to-compute-angles-of-horizontal-and-ve.patch Download (1.1 KB) - added by strk 2 years ago.
3434.diff Download (1.2 KB) - added by jef 2 years ago.
The attached patch is shorter, but I didn't test it - strk could you try it with your testcase, please?

Change History

  Changed 2 years ago by strk

Further debugging shows that the problem has to do with the final segment being _exactly_ horizontal. I suspect there's en equal problem with perfectly vertical lines, as per this other snapshot:  http://strk.keybit.net/tmp/ArrowHeadHell.png

  Changed 2 years ago by strk

Found and fixed. Attached format-patch (good to apply with git-am). Problem was for both vertical and horizontal lines. Fixed the vertical case (int vs. float) and the horizontal case (just missing).

  Changed 2 years ago by mhugent

  • owner changed from nobody to wonder
  • type changed from bug to patch

Changed 2 years ago by jef

The attached patch is shorter, but I didn't test it - strk could you try it with your testcase, please?

follow-up: ↓ 5   Changed 2 years ago by strk

jef suggested this much simplified version:  http://paste.debian.net/105578/ I've tested it and works fine.

in reply to: ↑ 4   Changed 2 years ago by jef

  • status changed from new to closed
  • resolution set to fixed

Replying to strk:

jef suggested this much simplified version:  http://paste.debian.net/105578/ I've tested it and works fine.

Thanks. Applied in r15076.

Note: See TracTickets for help on using tickets.