@@ -160,7 +160,7 @@ describe("computeRotationPosition", () => {
160160 test . each ( [ Math . PI / 2 , Math . PI / 3 , Math . PI / 4 ] ) ( "Positive Rotation" , ( rotation ) => {
161161 const sin = Math . sin ( rotation ) ;
162162 const newX = textBox . x + ( sin * textHeight ) / 2 ;
163- const newY = textBox . y ;
163+ const newY = textBox . y - textHeight / 2 + sin * textHeight ;
164164
165165 expect ( computeRotationPosition ( textBox , { ...style , rotation } ) ) . toMatchObject ( {
166166 x : expect . toBeCloseTo ( rotate ( newX , newY , rotation ) . x ) ,
@@ -171,7 +171,7 @@ describe("computeRotationPosition", () => {
171171 test . each ( [ - Math . PI / 2 , - Math . PI / 3 , - Math . PI / 4 ] ) ( "Negative Rotation" , ( rotation ) => {
172172 const sin = Math . sin ( rotation ) ;
173173 const newX = textBox . x + ( sin * textHeight ) / 2 ;
174- const newY = textBox . y ;
174+ const newY = textBox . y - textHeight / 2 - sin * textHeight ;
175175 expect ( computeRotationPosition ( textBox , { ...style , rotation } ) ) . toMatchObject ( {
176176 x : expect . toBeCloseTo ( rotate ( newX , newY , rotation ) . x ) ,
177177 y : expect . toBeCloseTo ( rotate ( newX , newY , rotation ) . y ) ,
0 commit comments