Bug 61119 - Fix preset shape rendering and shading
Summary: Fix preset shape rendering and shading
Alias: None
Product: POI
Classification: Unclassified
Component: SL Common (show other bugs)
Version: 3.17-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2017-05-24 00:29 UTC by Andreas Beeker
Modified: 2017-05-30 09:35 UTC (History)
0 users

Test file for preset definitions (973.06 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2017-05-24 00:29 UTC, Andreas Beeker
Geometry patch (preview) (11.70 KB, patch)
2017-05-24 00:31 UTC, Andreas Beeker
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Beeker 2017-05-24 00:29:03 UTC
Created attachment 35006 [details]
Test file for preset definitions

The rendering of the preset shapes has actually quite some errors.
The main problem is connected with the way arcs are displayed in AWT [1], i.e.
> angles are specified relative to the non-square framing rectangle
> such that 45 degrees always falls on the line from the center of
> the ellipse to the upper right corner of the framing rectangle

Additional the old code used Math.atan() where it should use Math.atan2(), which also covers the cases on the other side of the axis.

And ArcTanExpression actually should return a OOXML angle.

[1] https://docs.oracle.com/javase/6/docs/api/java/awt/geom/Arc2D.html
Comment 1 Andreas Beeker 2017-05-24 00:31:37 UTC
Created attachment 35007 [details]
Geometry patch (preview)

This is a preview of a not-to far commit.

Currently I'm also looking into supporting different shadings which are used in the preset shapes ...
Comment 2 Andreas Beeker 2017-05-30 09:35:55 UTC
applied with r1796823
Thanks to Michael Ford for bringing this up

- Fixed conversion of ooxml to awt angle
- replace subclasses and reflection calls with enums
- implemented tinting/shading of preset shapes