diff options
author | yipstanley <stanley_yip@brown.edu> | 2019-11-09 16:27:07 -0500 |
---|---|---|
committer | yipstanley <stanley_yip@brown.edu> | 2019-11-09 16:27:07 -0500 |
commit | 563a8926c0646e9907c8a4eec2e648ab5ae79e02 (patch) | |
tree | bc516c6e5991fb3ad10f962e94636738343891c3 /src/client/views/InkingCanvas.tsx | |
parent | ab5a893493e150337f0b193344f73bc7aa12afe5 (diff) |
hey, Sam's pushing these changes
Diffstat (limited to 'src/client/views/InkingCanvas.tsx')
-rw-r--r-- | src/client/views/InkingCanvas.tsx | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/client/views/InkingCanvas.tsx b/src/client/views/InkingCanvas.tsx index 5c17696c8..a0ea37300 100644 --- a/src/client/views/InkingCanvas.tsx +++ b/src/client/views/InkingCanvas.tsx @@ -170,37 +170,37 @@ export class InkingCanvas extends Touchable<InkCanvasProps> { this.inkData = data; } - @computed - get drawnPaths() { - let curTimecode = NumCast(this.props.Document.currentTimecode, -1); - let paths = Array.from(this.inkData).reduce((paths, [id, strokeData]) => { - if (strokeData.displayTimecode === -1 || (Math.abs(Math.round(strokeData.displayTimecode) - Math.round(curTimecode)) < 3)) { - paths.push(<InkingStroke key={id} id={id} - line={strokeData.pathData} - count={strokeData.pathData.length} - offsetX={this.maxCanvasDim - this.inkMidX} - offsetY={this.maxCanvasDim - this.inkMidY} - color={strokeData.color} - width={strokeData.width} - tool={strokeData.tool} - creationTime={strokeData.creationTime} - deleteCallback={this.removeLine} />); - } - return paths; - }, [] as JSX.Element[]); - let markerPaths = paths.filter(path => path.props.tool === InkTool.Highlighter); - let penPaths = paths.filter(path => path.props.tool !== InkTool.Highlighter); - return [!penPaths.length ? (null) : - <svg className={`inkingCanvas-paths-ink`} key="Pens" - style={{ left: `${this.inkMidX - this.maxCanvasDim}px`, top: `${this.inkMidY - this.maxCanvasDim}px` }} > - {penPaths} - </svg>, - !markerPaths.length ? (null) : - <svg className={`inkingCanvas-paths-markers`} key="Markers" - style={{ left: `${this.inkMidX - this.maxCanvasDim}px`, top: `${this.inkMidY - this.maxCanvasDim}px` }}> - {markerPaths} - </svg>]; - } + // @computed + // get drawnPaths() { + // let curTimecode = NumCast(this.props.Document.currentTimecode, -1); + // let paths = Array.from(this.inkData).reduce((paths, [id, strokeData]) => { + // if (strokeData.displayTimecode === -1 || (Math.abs(Math.round(strokeData.displayTimecode) - Math.round(curTimecode)) < 3)) { + // paths.push(<InkingStroke key={id} id={id} + // line={strokeData.pathData} + // count={strokeData.pathData.length} + // offsetX={this.maxCanvasDim - this.inkMidX} + // offsetY={this.maxCanvasDim - this.inkMidY} + // color={strokeData.color} + // width={strokeData.width} + // tool={strokeData.tool} + // creationTime={strokeData.creationTime} + // deleteCallback={this.removeLine} />); + // } + // return paths; + // }, [] as JSX.Element[]); + // let markerPaths = paths.filter(path => path.props.tool === InkTool.Highlighter); + // let penPaths = paths.filter(path => path.props.tool !== InkTool.Highlighter); + // return [!penPaths.length ? (null) : + // <svg className={`inkingCanvas-paths-ink`} key="Pens" + // style={{ left: `${this.inkMidX - this.maxCanvasDim}px`, top: `${this.inkMidY - this.maxCanvasDim}px` }} > + // {penPaths} + // </svg>, + // !markerPaths.length ? (null) : + // <svg className={`inkingCanvas-paths-markers`} key="Markers" + // style={{ left: `${this.inkMidX - this.maxCanvasDim}px`, top: `${this.inkMidY - this.maxCanvasDim}px` }}> + // {markerPaths} + // </svg>]; + // } render() { let svgCanvasStyle = InkingControl.Instance.selectedTool !== InkTool.None && !this.props.Document.isBackground ? "canSelect" : "noSelect"; @@ -210,7 +210,7 @@ export class InkingCanvas extends Touchable<InkCanvasProps> { <div className="inkingCanvas"> <div className={`inkingCanvas-${svgCanvasStyle}`} onPointerDown={this.onPointerDown} onTouchStart={this.onTouchStart} style={{ cursor: cursor }} /> {this.props.children()} - {this.drawnPaths} + {/* {this.drawnPaths} */} </div > ); } |