Skip to content

Commit

Permalink
Merge pull request #865 from sisobus/fix-freehand-#774
Browse files Browse the repository at this point in the history
add firing measurement modified event
  • Loading branch information
JamesAPetts authored Mar 29, 2019
2 parents 4a6dae2 + 585f654 commit 15c1e6c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ docs/latest/api
dist/
junit.xml
.DS_Store

## Only track CI's lock
yarn.lock
16 changes: 16 additions & 0 deletions src/tools/annotation/FreehandMouseTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ export default class FreehandMouseTool extends BaseAnnotationTool {

// Force onImageRendered to fire
external.cornerstone.updateImage(eventData.element);
this.fireModifiedEvent(eventData.element, data);
}

/**
Expand Down Expand Up @@ -1131,6 +1132,8 @@ export default class FreehandMouseTool extends BaseAnnotationTool {
}

external.cornerstone.updateImage(element);

this.fireModifiedEvent(element, data);
}

/**
Expand Down Expand Up @@ -1590,6 +1593,19 @@ export default class FreehandMouseTool extends BaseAnnotationTool {
}
}

/**
* Fire cornerstonetoolsmeasurementmodified event on provided element
* @param {any} element which freehand data has been modified
* @param {any} data the measurment data
*/
fireModifiedEvent(element, data) {
external.cornerstone.triggerEvent(
element,
EVENTS.MEASUREMENT_MODIFIED,
data
);
}

// ===================================================================
// Public Configuration API. .
// ===================================================================
Expand Down

0 comments on commit 15c1e6c

Please sign in to comment.