@@ -300,7 +300,7 @@ function getTransformToMoveInsideBar(x0, x1, y0, y1, textBB, orientation) {
300
300
scale = Math . min ( barHeight / textWidth , barWidth / textHeight ) ;
301
301
}
302
302
303
- if ( rotate ) rotate = - 90 ; // rotate counter- clockwise
303
+ if ( rotate ) rotate = 90 ; // rotate clockwise
304
304
305
305
// compute text and target positions
306
306
if ( rotate ) {
@@ -388,6 +388,8 @@ function getTransformToMoveOutsideBar(x0, x1, y0, y1, textBB, orientation) {
388
388
scale = barWidth / textHeight ;
389
389
}
390
390
391
+ if ( rotate ) rotate = 90 ; // rotate clockwise
392
+
391
393
// compute text and target positions
392
394
var textX = ( textBB . left + textBB . right ) / 2 ,
393
395
textY = ( textBB . top + textBB . bottom ) / 2 ,
@@ -409,25 +411,21 @@ function getTransformToMoveOutsideBar(x0, x1, y0, y1, textBB, orientation) {
409
411
// bar end is on the left hand side
410
412
targetX = x1 - textpad - targetWidth / 2 ;
411
413
targetY = ( y0 + y1 ) / 2 ;
412
- if ( rotate ) rotate = - 90 ; // rotate counter-clockwise
413
414
}
414
415
else {
415
416
targetX = x1 + textpad + targetWidth / 2 ;
416
417
targetY = ( y0 + y1 ) / 2 ;
417
- if ( rotate ) rotate = 90 ; // rotate clockwise
418
418
}
419
419
}
420
420
else {
421
421
if ( y1 > y0 ) {
422
422
// bar end is on the bottom
423
423
targetX = ( x0 + x1 ) / 2 ;
424
424
targetY = y1 + textpad + targetHeight / 2 ;
425
- if ( rotate ) rotate = - 90 ; // rotate counter-clockwise
426
425
}
427
426
else {
428
427
targetX = ( x0 + x1 ) / 2 ;
429
428
targetY = y1 - textpad - targetHeight / 2 ;
430
- if ( rotate ) rotate = 90 ; // rotate clockwise
431
429
}
432
430
}
433
431
0 commit comments