Date: prev next · Thread: first prev next last
2019 Archives by date, by thread · List index


Hi all,

I'm going to fix problems with custom shape commands U (angle-ellipse) and T (angle-ellipseto). The main problems currently are, that y-values are mirrored and negative angles are set to 0. https://bugs.documentfoundation.org/show_bug.cgi?id=121845

My work will only handle the case of "non-primitive" shape type and will have no effects on our MS-similar shapes.


My problem is the behavior for edge cases.
The ODF spec has the text:
"Draws a segment of an ellipse. The ellipse is specified by the center(x, y), the size(w, h) and the start-angle t0 in degrees and end-angle t1 in degrees. The segment is drawn clockwise."

The problem, that w and h has to be radius and not diameter, is tracked in https://issues.oasis-open.org/browse/OFFICE-3711. I will use radius.


Here my edge case problems:

1.
Which range is allowed for t0 and t1?
Minimal version: 0deg <= angle < 360deg.
Maximal version: all angles allowed.
I tend to allow all angles and interpret them as position modulo 360deg with right 0deg, down 90deg, left 180deg and up 270deg (from user point of view).

2.
What happens, if |t1-t0| >= 360deg?
I tend to draw a full ellipse starting in t0 and then add the segment till t1, both modulo 360. Start and end are needed, because the ellipse might have lines before and after.


3.
What happens, if t0 > t1?
I tend to use t0 and t1 modulo 360deg as positions and draw the segment clockwise. Thus start=330deg and end=90deg would draw a segment over 0deg. I do not want to draw counter-clockwise, because for that, LibreOffice has introduced the command arcangleto (command G) with a start angle and a -possibly negative- swing angle. And the spec explicitly says "is drawn clockwise" for the T command.

What do you think?

I have collected a lot of such edge cases in http://bugs.documentfoundation.org/attachment.cgi?id=148277


I consider the implementation in PowerPoint as faulty, because it uses up 0deg, left 90deg, down 180deg and right 270deg. I consider the implementation in Karbon as faulty, because the segments are drawn counter-clockwise.

Do you know other apps, not based on LibreOffice, which can read .odg or .odp files?

Kind regards
Regina

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.