From feef2c656b7f4cee5375d41322be7a65ba098379 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Sun, 31 Mar 2019 23:36:12 -0400 Subject: fixed ink to draw over documents --- src/client/views/InkingCanvas.scss | 9 ++++++--- src/client/views/InkingCanvas.tsx | 27 +++++++++++++++++++++------ 2 files changed, 27 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/client/views/InkingCanvas.scss b/src/client/views/InkingCanvas.scss index 6d7821cd2..abe6990b6 100644 --- a/src/client/views/InkingCanvas.scss +++ b/src/client/views/InkingCanvas.scss @@ -1,12 +1,11 @@ @import "global_variables"; -.inkingCanvas-paths, .inkingCanvas-paths-none { +.inkingCanvas-paths-ink, .inkingCanvas-paths-markers, .inkingCanvas-paths { position: absolute; top: -50000px; left: -50000px; width: 100000px; height: 100000px; - //z-index: 10000; // z-index: 99; //overlays ink on top of everything but that messes up blending and events don't propagate down to nested collections .highlight { mix-blend-mode: multiply; } @@ -18,8 +17,12 @@ pointer-events: auto; } -.inkingCanvas-paths-none { +.inkingCanvas-paths-ink, .inkingCanvas-paths-markers { pointer-events: none; + z-index: 10000; // overlays ink on top of everything cursor: "arrow"; } +.inkingCanvas-paths-markers { + mix-blend-mode: multiply; +} diff --git a/src/client/views/InkingCanvas.tsx b/src/client/views/InkingCanvas.tsx index a971264b9..fd9e6826a 100644 --- a/src/client/views/InkingCanvas.tsx +++ b/src/client/views/InkingCanvas.tsx @@ -137,8 +137,20 @@ export class InkingCanvas extends React.Component { render() { // parse data from server let curPage = this.props.Document.GetNumber(KeyStore.CurPage, -1) - let paths = Array.from(this.inkData).reduce((paths, [id, strokeData]) => { - if (strokeData.page == -1 || strokeData.page == curPage) + let markerpaths = Array.from(this.inkData).reduce((paths, [id, strokeData]) => { + if ((strokeData.page == -1 || strokeData.page == curPage) && + strokeData.tool == InkTool.Highlighter) + paths.push() + return paths; + }, [] as JSX.Element[]); + let penpaths = Array.from(this.inkData).reduce((paths, [id, strokeData]) => { + if ((strokeData.page == -1 || strokeData.page == curPage) && + strokeData.tool == InkTool.Pen) paths.push( { deleteCallback={this.removeLine} />) return paths; }, [] as JSX.Element[]); - let svgCanvasStyle = InkingControl.Instance.selectedTool == InkTool.None ? "-none" : ""; return (
- - {paths} - + {this.props.children} + + {markerpaths} + + + {penpaths} +
) } -- cgit v1.2.3-70-g09d2