Buggy code:
public class FourUserTouchEditable extends BorderPane { private static final int RIGHT_TOGGLE_INDEX = 3 ; private static final int BOTTOM_TOGGLE_INDEX = 2 ; private static final int LEFT_TOGGLE_INDEX = 1 ; private static final int TOP_TOGGLE_INDEX = 0 ; private static final Logger LOG = LoggerFactory . getLogger ( FourUserTouchEditable . class ) ; public class SelectionChanged { public final int index ; public final boolean isSelected ; public SelectionChanged ( int index , boolean value ) { } } public enum State { UNSELECTED , SELECTED , MOVING , ROTATING ; } @ FXML private ToggleGroup toggleGroup ; @ FXML private ToggleButton topToggle ; @ FXML private ToggleButton leftToggle ; @ FXML private ToggleButton rightToggle ; @ FXML private ToggleButton bottomToggle ; @ FXML private Label caption ; private Color rotationColor ; private double rotationStrokeSize ; private Circle rotateIndicator ; private SimpleObjectProperty < FourUserTouchEditable . State > state = new SimpleObjectProperty < > ( ) ; private LowLevelInteractionListener lowLevelInteractionListener ; private SimpleObjectProperty < FourUserTouchEditable . SelectionChanged > selectionChangedProperty ; public FourUserTouchEditable ( ) { } private void initInteraction ( ) { } private void initChangeIfEmpty ( ) { } private void initSelectionChangeProperty ( ) { } private void changeIfEmpty ( String n ) { } private void constructRotateIndicator ( ) { } private void fixPositionsOnStateChange ( ) { } private void fixPositionOnStateChange ( FourUserTouchEditable . State oldState , FourUserTouchEditable . State newState ) { } private void keepAtLeastOneSelected ( ) { } private void stopUnselecting ( ToggleButton b ) { } private void tryLoadingFXMLOrThrow ( FXMLLoader loader ) { } private void constructResizable ( Label txt ) { } public void toSelectedState ( ) { } public void toUnselectedState ( ) { } public void toRotateState ( ) { } public void toMovingState ( ) { } private void setDisableAndHiddenToAll ( boolean b ) { } private void setDisableAndHiddenToRotate ( boolean b ) { } private void setDisableAndHiddenToToggles ( boolean b ) { } private void setDisabledAndHidden ( boolean b , ToggleButton t ) { } public Bounds getOverlayBounds ( ) { } public void translateRelative ( double x , double y ) { } public void setText ( String text ) { } public String getText ( ) { } public StringProperty textProperty ( ) { } public void setSelected ( int index , boolean b ) { } public void setTopToggleText ( String txt ) { } public String getTopToggleText ( ) { } public void setLeftToggleText ( String txt ) { } public String getLeftToggleText ( ) { } public void setRightToggleText ( String txt ) { } public String getRightToggleText ( ) { } public void setBottomToggleText ( String txt ) { } public String getBottomToggleText ( ) { } public void setTopSelected ( boolean isSelected ) { } public void setLeftSelected ( boolean isSelected ) { } public void setRightSelected ( boolean isSelected ) { } public void setBottomSelected ( boolean isSelected ) { } public boolean isTopSelected ( ) { } public boolean isLeftSelected ( ) { } public boolean isRightSelected ( ) { } public boolean isBottomSelected ( ) { } public BooleanProperty topSelectedProperty ( ) { } public BooleanProperty leftSelectedProperty ( ) { } public BooleanProperty rightSelectedProperty ( ) { } public BooleanProperty bottomSelectedProperty ( ) { } public FourUserTouchEditable . State getState ( ) { } public ReadOnlyObjectProperty < FourUserTouchEditable . State > stateProperty ( ) { } public void setRotationColor ( Color rotationColor ) { } public double getRotationStrokeSize ( ) { } public void setRotationStrokeSize ( double rotationStrokeSize ) { } public Bounds getBoundsInScene ( ) { } public Point2D getCenterAsSceneCoordinates ( ) { Point2D p = new Point2D ( ( ( this . getWidth ( ) ) // 2 ) , ( ( this . getHeight ( ) ) // 2 ) ) ; <START_BUG> return this . getLocalToSceneTransform ( ) . transform ( p ) ; <END_BUG> } public Point2D getOrigin ( ) { } public void setOnMoved ( OnMovedInterface moved ) { } public void setOnMoving ( OnMovingInterface < Double , Double , Double > movingFunction ) { } public ObjectProperty < FourUserTouchEditable . SelectionChanged > selectionChangedProperty ( ) { } }

Fix:
return this . getLocalToParentTransform ( ) . transform ( p ) ;