← Prev in month
← Prev in thread
Next in thread →
Next in month →
Re: [opendocument-users] draw:transform issues
On Thu, Jan 19, 2006 at 07:14:38PM -0800, Chris Nokleberg wrote:
> - Please specify whether the angle arguments for rotate, skewX, and
> skewY are supposed to be in degrees or radians. OpenOffice currently
> outputs values in radians.
Here is a list of all attributes in OpenDocument which use angles, the
units as defined by OpenDocument/SVG, and what is actually used by
OpenOffice.
- svg:start-angle, svg:end-angle
OpenDocument: undefined
OpenOffice: degrees
SVG: degrees
- draw:transform
OpenDocument: undefined
OpenOffice: radians
- draw:text-rotate-angle
OpenDocument: undefined
OpenOffice: degrees
- draw:extrusion-rotation-angle
OpenDocument: undefined
OpenOffice: degrees
- draw:enhanced-path (T and U command angles)
OpenDocument: undefined
OpenOffice: degrees, but sometimes shifted left by 16 bits!
- draw:glue-point-leaving-directions
OpenDocument: grad
OpenOffice: ?
- draw:handle-position (polar mode, first param)
OpenDocument: grad
OpenOffice: degrees
- draw:angle (used for gradients)
OpenDocument: undefined
OpenOffice: probably degrees but (always?) saved as zero
- draw:rotation (used for hatch fills)
OpenDocument: undefined
OpenOffice: probably degrees but (always?) saved as zero
- draw:caption-angle
OpenDocument: undefined
OpenOffice: ?
- dr3d:shadow-slant
OpenDocument: undefined
OpenOffice: degrees
- dr3d:end-angle
OpenDocument: degrees
OpenOffice: ?
- dr3d:transform (a clear 3D-analogue of draw:transform)
OpenDocument: degrees
OpenOffice: radians (?)
- style:text-rotation-angle
OpenDocument: degrees
OpenOffice: ?
- style:rotation-angle (spreadsheet cell)
OpenDocument: degrees
OpenOffice: degrees
The question marks are for attributes which I could not manage to
generate in OpenOffice. If anyone knows how to fill these in, please let
me know.
360 degrees = 2*PI radians = 400 grad, but even though
draw:handle-position is defined as using grad, I believe OpenOffice
actually uses degrees. I don't know how grad slipped in
there. glue-point-leaving-directions is also defined as grad, but AFAIK
OpenOffice doesn't supports that attribute.
Because degrees are used everywhere in OpenOffice, except for
draw:transform and (maybe) dr3d:transform, that seems like the obvious
unit to standardize on. It is also more user-friendly for hand-edited
documents.
Obviously the problem with specifying draw:transform rotation as degrees
is that it will break existing OpenOffice documents.
One suggestion is to add a "rotation_units" attribute to specify the
units. I think this would be more confusing than helpful, if the default
was still going to be radians. The problem is not that users really need
a way to define rotation in degrees, just that having the default unit
vary from one attribute to another is bizarre.
In general, I feel that the current number of OpenDocument documents is
negligible compared to the future number, so now is the best time to
make breaking changes. Also, IMHO OpenOffice is buggy enough that I don't
think it is a good precedent to use it in a "reference implementation"
capacity. Along these lines, the way that OpenOffice *renders* rotation
transforms is incorrect (a separate issue), so defining the unit as
degrees would not necessarily be "breaking" anything, as their documents
are already "broken". I can go into this in more depth if anyone is
interested.
I don't think that there is much cross-application sharing of
OpenDocument docs right now, so *if* OpenOffice could determine which
version a document was generated using, it could self-correct its spec
implementation bugs. I don't know if this is possible. In any case, it
might be a good idea for office suites in general to include the app
version when saving a document, to be able to handle these kind of
changes in the future.
Chris
← Prev in month
← Prev in thread
Next in thread →
Next in month →