use of com.codename1.ui.geom.GeneralPath in project CodenameOne by codenameone.
the class ChartComponent method screenToChartShape.
/**
* Converts a chart coordinate spaced shape to the same shape in the screen coordinate space
* @param s shape in screen coordinates
* @return same shape using chart space coordinates
*/
public Shape screenToChartShape(Shape s) {
GeneralPath p = new GeneralPath();
Transform t = Transform.makeIdentity();
if (currentTransform != null) {
t.concatenate(currentTransform.getInverse());
}
t.translate(-getAbsoluteX(), -getAbsoluteY());
p.append(s.getPathIterator(t), false);
return p;
}
Aggregations