Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 497495

Summary: Performance optimization in AbstractInterpolator#arrangeDecoration()
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF FXAssignee: 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:

Description Matthias Wienand CLA 2016-07-07 10:41:23 EDT
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.
Comment 1 Matthias Wienand CLA 2016-07-15 14:11:39 EDT
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.