From 22309aa2519d4c543ad28920d6ff82906cc8af1c Mon Sep 17 00:00:00 2001 From: Diego Hennrich Date: Thu, 23 Mar 2023 22:19:16 -0300 Subject: [PATCH] fix(mobile): Crosshairs highlighted for mobile (#493) * Crosshairs highlighted for mobile * Stroke Width transfer --- packages/tools/src/tools/CrosshairsTool.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/tools/src/tools/CrosshairsTool.ts b/packages/tools/src/tools/CrosshairsTool.ts index 8dfb3e6b6..1b4864bad 100644 --- a/packages/tools/src/tools/CrosshairsTool.ts +++ b/packages/tools/src/tools/CrosshairsTool.ts @@ -113,6 +113,11 @@ const EPSILON = 1e-3; class CrosshairsTool extends AnnotationTool { static toolName; + // define the stroke width for mobile/web screen + private widthStrokeAnnotation = /Mobi|Android/i.test(navigator.userAgent) + ? 2.5 + : 1; + toolCenter: Types.Point3 = [0, 0, 0]; // NOTE: it is assumed that all the active/linked viewports share the same crosshair center. // This because the rotation operation rotates also all the other active/intersecting reference lines of the same angle _getReferenceLineColor?: (viewportId: string) => string; @@ -1108,7 +1113,9 @@ class CrosshairsTool extends AnnotationTool { let color = viewportColor !== undefined ? viewportColor : 'rgb(200, 200, 200)'; - let lineWidth = 1; + + let lineWidth = this.widthStrokeAnnotation; + const lineActive = data.handles.activeOperation !== null && data.handles.activeOperation === OPERATION.DRAG &&