Skip to content

Commit

Permalink
fix: toolName instead of toolType, and better data for brush on MEASU…
Browse files Browse the repository at this point in the history
…REMENT_COMPLETED
  • Loading branch information
Zaid-Safadi authored and dannyrb committed Jun 27, 2019
1 parent 325fecc commit 1d23c96
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/tools/base/BaseBrushTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,18 @@ class BaseBrushTool extends BaseTool {
this._drawing = false;
this._mouseUpRender = true;

const measurementData =
let measurementData = null;
const brushModule = store.modules.brush;
const toolState =
getToolState(element, this.name) || getToolState(element, 'brush');
const currentSegmentationIndex = brushModule.state.drawColorId;

if (toolState.data && toolState.data.length > currentSegmentationIndex) {
measurementData = toolState.data[currentSegmentationIndex];
}

const eventData = {
toolType: this.name,
toolName: this.name,
element,
measurementData,
evtDetail: evt.detail,
Expand Down

0 comments on commit 1d23c96

Please sign in to comment.