Apache OpenOffice (AOO) Bugzilla – Issue 123384
[SVG] marker direction must not depend on length of path segment
Last modified: 2014-08-01 13:31:58 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.
Created attachment 81687 [details] normalize vectors, so that diagonal equals angle bisector
Does atan2 need a domain check here?
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.
Armin, please look and commit it, if you like it.
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 ***
Verified on AOO411m4(Build:9774) - Rev. 1614049 (=RC1)