Skip to content

Commit

Permalink
fix(mobile): Crosshairs highlighted for mobile (#493)
Browse files Browse the repository at this point in the history
* Crosshairs highlighted for mobile

* Stroke Width transfer
  • Loading branch information
diegohennrich authored Mar 24, 2023
1 parent 34a22a5 commit 22309aa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/tools/src/tools/CrosshairsTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 &&
Expand Down

0 comments on commit 22309aa

Please sign in to comment.