@@ -7,6 +7,7 @@ export default class P2BodyEditor {
77
88 sizeRow : SupClient . table . RowParts ;
99 radiusRow : SupClient . table . RowParts ;
10+ angleRow : SupClient . table . RowParts ;
1011
1112 constructor ( tbody : HTMLTableSectionElement , config : any , projectClient : SupClient . ProjectClient , editConfig : any ) {
1213 this . tbody = tbody ;
@@ -61,6 +62,12 @@ export default class P2BodyEditor {
6162 this . editConfig ( "setProperty" , "height" , parseFloat ( event . target . value ) ) ;
6263 } ) ;
6364
65+ this . angleRow = SupClient . table . appendRow ( this . tbody , SupClient . i18n . t ( "componentEditors:P2Body.angle" ) ) ;
66+ this . fields [ "angle" ] = SupClient . table . appendNumberField ( this . angleRow . valueCell , config . angle , { min : - 360 , max : 360 } ) ;
67+ this . fields [ "angle" ] . addEventListener ( "change" , ( event : any ) => {
68+ this . editConfig ( "setProperty" , "angle" , parseFloat ( event . target . value ) ) ;
69+ } ) ;
70+
6471 // Circle
6572 this . radiusRow = SupClient . table . appendRow ( this . tbody , SupClient . i18n . t ( "componentEditors:P2Body.radius" ) ) ;
6673 this . fields [ "radius" ] = SupClient . table . appendNumberField ( this . radiusRow . valueCell , config . radius , { min : 0 } ) ;
@@ -76,11 +83,13 @@ export default class P2BodyEditor {
7683 case "box" : {
7784 this . sizeRow . row . hidden = false ;
7885 this . radiusRow . row . hidden = true ;
86+ this . angleRow . row . hidden = false ;
7987 } break ;
8088
8189 case "circle" : {
8290 this . sizeRow . row . hidden = true ;
8391 this . radiusRow . row . hidden = false ;
92+ this . angleRow . row . hidden = true ;
8493 } break ;
8594 }
8695 }
0 commit comments