@@ -135,6 +135,9 @@ class CrosshairsTool extends AnnotationTool {
135
135
enabled : false ,
136
136
panSize : 10 ,
137
137
} ,
138
+ handleRadius : 3 ,
139
+ // Enable HDPI rendering for handles using devicePixelRatio
140
+ enableHDPIHandles : false ,
138
141
// radius of the area around the intersection of the planes, in which
139
142
// the reference lines will not be rendered. This is only used when
140
143
// having 3 viewports in the toolGroup.
@@ -1270,6 +1273,15 @@ class CrosshairsTool extends AnnotationTool {
1270
1273
slabThicknessHandleWorldFour
1271
1274
) ;
1272
1275
1276
+ let handleRadius =
1277
+ this . configuration . handleRadius *
1278
+ ( this . configuration . enableHDPIHandles ? window . devicePixelRatio : 1 ) ;
1279
+ let opacity = 1 ;
1280
+ if ( this . configuration . mobile ?. enabled ) {
1281
+ handleRadius = this . configuration . mobile . handleRadius ;
1282
+ opacity = this . configuration . mobile . opacity ;
1283
+ }
1284
+
1273
1285
if (
1274
1286
( lineActive || this . configuration . mobile ?. enabled ) &&
1275
1287
! rotHandlesActive &&
@@ -1286,12 +1298,8 @@ class CrosshairsTool extends AnnotationTool {
1286
1298
rotationHandles ,
1287
1299
{
1288
1300
color,
1289
- handleRadius : this . configuration . mobile ?. enabled
1290
- ? this . configuration . mobile ?. handleRadius
1291
- : 3 ,
1292
- opacity : this . configuration . mobile ?. enabled
1293
- ? this . configuration . mobile ?. opacity
1294
- : 1 ,
1301
+ handleRadius,
1302
+ opacity,
1295
1303
type : 'circle' ,
1296
1304
}
1297
1305
) ;
@@ -1303,12 +1311,8 @@ class CrosshairsTool extends AnnotationTool {
1303
1311
slabThicknessHandles ,
1304
1312
{
1305
1313
color,
1306
- handleRadius : this . configuration . mobile ?. enabled
1307
- ? this . configuration . mobile ?. handleRadius
1308
- : 3 ,
1309
- opacity : this . configuration . mobile ?. enabled
1310
- ? this . configuration . mobile ?. opacity
1311
- : 1 ,
1314
+ handleRadius,
1315
+ opacity,
1312
1316
type : 'rect' ,
1313
1317
}
1314
1318
) ;
@@ -1327,12 +1331,8 @@ class CrosshairsTool extends AnnotationTool {
1327
1331
rotationHandles ,
1328
1332
{
1329
1333
color,
1330
- handleRadius : this . configuration . mobile ?. enabled
1331
- ? this . configuration . mobile ?. handleRadius
1332
- : 3 ,
1333
- opacity : this . configuration . mobile ?. enabled
1334
- ? this . configuration . mobile ?. opacity
1335
- : 1 ,
1334
+ handleRadius,
1335
+ opacity,
1336
1336
type : 'circle' ,
1337
1337
}
1338
1338
) ;
@@ -1351,17 +1351,18 @@ class CrosshairsTool extends AnnotationTool {
1351
1351
slabThicknessHandles ,
1352
1352
{
1353
1353
color,
1354
- handleRadius : this . configuration . mobile ?. enabled
1355
- ? this . configuration . mobile ?. handleRadius
1356
- : 3 ,
1357
- opacity : this . configuration . mobile ?. enabled
1358
- ? this . configuration . mobile ?. opacity
1359
- : 1 ,
1354
+ handleRadius,
1355
+ opacity,
1360
1356
type : 'rect' ,
1361
1357
}
1362
1358
) ;
1363
1359
} else if ( rotHandlesActive && viewportDraggableRotatable ) {
1364
1360
const handleUID = `${ lineIndex } ` ;
1361
+ const handleRadius =
1362
+ this . configuration . handleRadius *
1363
+ ( this . configuration . enableHDPIHandles
1364
+ ? window . devicePixelRatio
1365
+ : 1 ) ;
1365
1366
// draw all rotation handles as active
1366
1367
drawHandlesSvg (
1367
1368
svgDrawingHelper ,
@@ -1370,7 +1371,7 @@ class CrosshairsTool extends AnnotationTool {
1370
1371
rotationHandles ,
1371
1372
{
1372
1373
color,
1373
- handleRadius : 2 ,
1374
+ handleRadius,
1374
1375
fill : color ,
1375
1376
type : 'circle' ,
1376
1377
}
@@ -1380,6 +1381,11 @@ class CrosshairsTool extends AnnotationTool {
1380
1381
selectedViewportId &&
1381
1382
viewportSlabThicknessControlsOn
1382
1383
) {
1384
+ const handleRadius =
1385
+ this . configuration . handleRadius *
1386
+ ( this . configuration . enableHDPIHandles
1387
+ ? window . devicePixelRatio
1388
+ : 1 ) ;
1383
1389
// draw only the slab thickness handles for the active viewport as active
1384
1390
drawHandlesSvg (
1385
1391
svgDrawingHelper ,
@@ -1388,7 +1394,7 @@ class CrosshairsTool extends AnnotationTool {
1388
1394
slabThicknessHandles ,
1389
1395
{
1390
1396
color,
1391
- handleRadius : 2 ,
1397
+ handleRadius,
1392
1398
fill : color ,
1393
1399
type : 'rect' ,
1394
1400
}
0 commit comments