@@ -143,6 +143,12 @@ class CrosshairsTool extends AnnotationTool {
143
143
// renders a colored circle on top right of the viewports whose color
144
144
// matches the color of the reference line
145
145
viewportIndicators : true ,
146
+
147
+ viewportIndicatorsConfig : {
148
+ radius : 5 ,
149
+ x : null ,
150
+ y : null ,
151
+ } ,
146
152
// Auto pan is a configuration which will update pan
147
153
// other viewports in the toolGroup if the center of the crosshairs
148
154
// is outside of the viewport. This might be useful for the case
@@ -1449,21 +1455,24 @@ class CrosshairsTool extends AnnotationTool {
1449
1455
data . handles . slabThicknessPoints = newStpoints ;
1450
1456
1451
1457
if ( this . configuration . viewportIndicators ) {
1452
- // render a circle to pin point the viewport color
1453
- // TODO: This should not be part of the tool, and definitely not part of the renderAnnotation loop
1458
+ const { viewportIndicatorsConfig } = this . configuration ;
1459
+
1460
+ const xOffset = viewportIndicatorsConfig ?. xOffset || 0.95 ;
1461
+ const yOffset = viewportIndicatorsConfig ?. yOffset || 0.05 ;
1454
1462
const referenceColorCoordinates = [
1455
- clientWidth * 0.95 ,
1456
- clientHeight * 0.05 ,
1457
- ] as Types . Point2 ;
1463
+ clientWidth * xOffset ,
1464
+ clientHeight * yOffset ,
1465
+ ] ;
1466
+
1458
1467
const circleRadius =
1459
- ( canvasDiagonalLength / window . devicePixelRatio || 1 ) * 0.01 ;
1468
+ viewportIndicatorsConfig ?. circleRadius || canvasDiagonalLength * 0.01 ;
1460
1469
1461
1470
const circleUID = '0' ;
1462
1471
drawCircleSvg (
1463
1472
svgDrawingHelper ,
1464
1473
annotationUID ,
1465
1474
circleUID ,
1466
- referenceColorCoordinates ,
1475
+ referenceColorCoordinates as Types . Point2 ,
1467
1476
circleRadius ,
1468
1477
{ color, fill : color }
1469
1478
) ;
0 commit comments