Skip to content

Commit

Permalink
feat(pointState): reduce visual handle size
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Oct 10, 2023
1 parent b6faf80 commit 2810c61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export const Messages = {
},
} as const;

export const ANNOTATION_TOOL_HANDLE_RADIUS = 10; // pixels
export const ANNOTATION_TOOL_HANDLE_RADIUS = 6; // CSS pixels
export const PICKABLE_ANNOTATION_TOOL_HANDLE_RADIUS =
ANNOTATION_TOOL_HANDLE_RADIUS * 2;

export const ACTIONS = [
// set the current tool
Expand Down
6 changes: 3 additions & 3 deletions src/vtk/ToolWidgetUtils/pointState.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import vtkWidgetState from '@kitware/vtk.js/Widgets/Core/WidgetState';
import visibleMixin from '@kitware/vtk.js/Widgets/Core/StateBuilder/visibleMixin';
import scale1Mixin from '@kitware/vtk.js/Widgets/Core/StateBuilder/scale1Mixin';
import { watchStore } from '@/src/vtk/ToolWidgetUtils/utils';
import { ANNOTATION_TOOL_HANDLE_RADIUS } from '@/src/constants';
import { PICKABLE_ANNOTATION_TOOL_HANDLE_RADIUS } from '@/src/constants';
import { toRaw } from 'vue';

const PIXEL_SIZE = ANNOTATION_TOOL_HANDLE_RADIUS * 2;
const DIAMETER = PICKABLE_ANNOTATION_TOOL_HANDLE_RADIUS * 2;

function _createPointState(
publicAPI,
Expand All @@ -20,7 +20,7 @@ function _createPointState(
});
vtkWidgetState.extend(publicAPI, model, {});
visibleMixin.extend(publicAPI, model, { visible });
scale1Mixin.extend(publicAPI, model, { scale1: PIXEL_SIZE });
scale1Mixin.extend(publicAPI, model, { scale1: DIAMETER });

const getTool = () => {
return model._store.toolByID[model.id];
Expand Down

0 comments on commit 2810c61

Please sign in to comment.