Issue 123384 - [SVG] marker direction must not depend on length of path segment
Summary: [SVG] marker direction must not depend on length of path segment
Status: CLOSED DUPLICATE of issue 123379
Alias: None
Product: Draw
Classification: Application
Component: open-import (show other issues)
Version: 4.1.0-dev
Hardware: All All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-29 13:32 UTC by Regina Henschel
Modified: 2014-08-01 13:31 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Draw document with linked SVG graphics. (25.49 KB, application/zip)
2013-09-29 13:32 UTC, Regina Henschel
no flags Details
normalize vectors, so that diagonal equals angle bisector (775 bytes, patch)
2013-10-01 20:48 UTC, Regina Henschel
no flags Details | Diff
updated patch (914 bytes, patch)
2013-10-05 12:14 UTC, Regina Henschel
rb.henschel: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Regina Henschel 2013-09-29 13:32:27 UTC
Created attachment 81674 [details]
Draw document with linked SVG graphics.

The marker direction must only depend on the angle of the path segment, not on the length. See "11.6.2 The ‘marker’ element" in http://www.w3.org/TR/SVG/painting.html
"A value of 'auto' indicates that the marker is oriented such that its positive x-axis is pointing as follows:
    If there is a path segment coming into the vertex and another path segment going out of the vertex, the marker's positive x-axis should point toward the angle bisector for the angle at the given vertex, where that angle has one side consisting of tangent vector for the path segment going into the vertex and the other side the tangent vector for the path segment going out of the vertex."

Therefore in all cases in the attached example, the direction of the marker-mid has to be 315°, which is middle of 0° from h command and 270° from v command.
The graphics are linked, so that you can easily see, how they are rendered in browsers.
Comment 1 Regina Henschel 2013-10-01 20:48:13 UTC
Created attachment 81687 [details]
normalize vectors, so that diagonal equals angle bisector
Comment 2 Regina Henschel 2013-10-02 05:51:16 UTC
Does atan2 need a domain check here?
Comment 3 Regina Henschel 2013-10-05 12:14:26 UTC
Created attachment 81709 [details]
updated patch

Because "sal_uInt32 nIndex" the part "nIndex - 1" results in 0 and not in -1, therefore, for the start of a closed path, the incoming path segment was not considered.
I do not change the type, but make it positive before subtract of -1.
Comment 4 Regina Henschel 2013-10-05 12:19:22 UTC
Armin, please look and commit it, if you like it.
Comment 5 Armin Le Grand 2013-10-09 15:35:08 UTC
ALG: Hi Regina, thanks for the patch. I will handle this together with task 123379, setting to double. This task/patch helped a lot, I was not aware that the directions were wrong, maybe because this was not too obvious when the edges in play were nearly the same length!

*** This issue has been marked as a duplicate of issue 123379 ***
Comment 6 Regina Henschel 2014-08-01 13:31:49 UTC
Verified on AOO411m4(Build:9774)  -  Rev. 1614049 (=RC1)