| Summary: | Performance optimization in AbstractInterpolator#arrangeDecoration() | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Matthias Wienand <matthias.wienand> |
| Component: | GEF FX | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 1.0.0 | ||
| Target Milestone: | 4.1.0 (Neon.1) M1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
I exchanged the implementation as proposed and published the code on the R4_0_maintenance and master branches. Therefore, I resolve this ticket as fixed for 4.1.0 M1. |
We should replace the implementation of AbstractInterpolator#arrangeDecoration() with the following to enhance its performance: protected void arrangeDecoration(Node decoration, Point offset, Vector direction) { // arrange on start of curve AffineTransform transform = new AffineTransform().translate(offset.x, offset.y); // arrange on curve direction if (!direction.isNull()) { Angle angleCW = new Vector(1, 0).getAngleCW(direction); transform.rotate(angleCW.rad(), 0, 0); } // compensate stroke (ensure decoration 'ends' at curve end). transform.translate(-NodeUtils.getShapeBounds(decoration).getX(), 0); // apply transform decoration.getTransforms().setAll(Geometry2FX.toFXAffine(transform)); } The old implementation applied all transformations individually. The new implementation concatenates the transformations before applying them together.