Bug 61119

Summary: Fix preset shape rendering and shading
Product: POI Reporter: Andreas Beeker <kiwiwings>
Component: SL CommonAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.17-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Test file for preset definitions
Geometry patch (preview)

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