Try mxUtils.getValue(graph.view.getState(cell).style,mxConstants.STYLE_ROTATION,0)
#mxgraph : Retrieving Rotation value of a cell
-
27-06-2023 - |
Question
I'm trying to retrieve rotation value of currently selected cell, during and after rotation with handle.;
the cell "style" seems to hold the rotation value in its string but I did not find the way to retrieve it even with mxUtils.getValue(style, "rotation",0);
var cell = graph.getSelectionCell();
var preview = this.graphHandler;
// during mouse move
if (preview != null && preview.shape != null) {
var angle = preview.shape.rotation; }
else {
var angle = mxUtils.toRadians(mxUtils.getValue(cell.getStyle(),mxConstants.STYLE_ROTATION, 0));
// var angle = cell.state.shape.getShapeRotation();
}
Any help would be helpful
Philippe
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow