@@ -35,6 +35,7 @@ class ResizableRect extends Component {
35
35
height : PropTypes . number . isRequired ,
36
36
rotatable : PropTypes . bool ,
37
37
rotateAngle : PropTypes . number ,
38
+ parentRotateAngle : PropTypes . number ,
38
39
zoomable : PropTypes . string ,
39
40
minWidth : PropTypes . number ,
40
41
minHeight : PropTypes . number ,
@@ -53,6 +54,7 @@ class ResizableRect extends Component {
53
54
onDragEnd : PropTypes . func
54
55
}
55
56
static defaultProps = {
57
+ parentRotateAngle : 0 ,
56
58
rotateAngle : 0 ,
57
59
rotatable : true ,
58
60
zoomable : '' ,
@@ -82,8 +84,8 @@ class ResizableRect extends Component {
82
84
83
85
handleResize = ( length , alpha , rect , type , isShiftKey ) => {
84
86
if ( ! this . props . onResize ) return
85
- const { rotateAngle, aspectRatio, minWidth, minHeight } = this . props
86
- const beta = alpha - degToRadian ( rotateAngle )
87
+ const { rotateAngle, aspectRatio, minWidth, minHeight, parentRotateAngle } = this . props
88
+ const beta = alpha - degToRadian ( rotateAngle + parentRotateAngle )
87
89
const deltaW = length * Math . cos ( beta )
88
90
const deltaH = length * Math . sin ( beta )
89
91
const ratio = isShiftKey && ! aspectRatio ? rect . width / rect . height : aspectRatio
0 commit comments