Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Add per-drawing events
Browse files Browse the repository at this point in the history
  • Loading branch information
Niharika Khanna authored and chenba committed Mar 20, 2018
1 parent ace6bfb commit 00a92b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/METRICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ The hashed page ID (`{hash}`) is a simple SHA1(path), with no additional randomn
9. [x] Click on clear tool: `web/clear-select/annotation-toolbar`
8. [x] Open color picker: `web/color-picker-select/annotation-toolbar`
9. [x] Select a color from the color board: `web/color-change/annotation-color-board`
7. [x] Use pen tool: `web/draw/pen`
8. [x] Use highlight tool: `web/draw/highlight`


#### General Google Analytics information
Expand Down
3 changes: 3 additions & 0 deletions server/src/pages/shot/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,13 +610,16 @@ exports.Editor = class Editor extends React.Component {
drawMousedown = false;
points = [];
if (this.state.tool === "highlighter") {
sendEvent("draw", "highlight");
if (this.isColorWhite(this.state.color)) {
this.imageContext.globalCompositeOperation = "soft-light";
} else {
this.imageContext.globalCompositeOperation = "multiply";
}
this.imageContext.drawImage(this.highlighter, 0, 0);
this.highlightContext.clearRect(0, 0, this.imageCanvas.width, this.imageCanvas.height);
} else {
sendEvent("draw", "pen");
}
}

Expand Down

0 comments on commit 00a92b1

Please sign in to comment.