rotate JavaFX Path - Java javafx.scene.shape

Java examples for javafx.scene.shape:Path

Description

rotate JavaFX Path

Demo Code


//package com.java2s;

import javafx.scene.shape.Path;

import javafx.scene.transform.Affine;

public class Main {

    protected static Path rotatePath(Path path, double angle, double x,
            double y) { // ???
        if (angle == 0.0) {
            return path;
        }//  w w  w  .j a v a 2s .  c  o  m
        // Math.toRadians(360.0 - angle)
        path.getTransforms().add(Affine.rotate(angle, x, y));
        return path;
    }
}

Related Tutorials