aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/InkingCanvas.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-03-08 11:44:28 -0500
committerbob <bcz@cs.brown.edu>2019-03-08 11:44:28 -0500
commitc4eff83d814b1f9b94b7fc75ca06e8f0474de20d (patch)
tree02efbc5b170add4641982909ce12b2e0369ae5bb /src/client/views/InkingCanvas.tsx
parent4796d17b089824df4455788c564414526c08eaa4 (diff)
working version of pdfs with annotations.
Diffstat (limited to 'src/client/views/InkingCanvas.tsx')
-rw-r--r--src/client/views/InkingCanvas.tsx17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/client/views/InkingCanvas.tsx b/src/client/views/InkingCanvas.tsx
index baf1567b7..14a779837 100644
--- a/src/client/views/InkingCanvas.tsx
+++ b/src/client/views/InkingCanvas.tsx
@@ -66,7 +66,8 @@ export class InkingCanvas extends React.Component<InkCanvasProps> {
pathData: [point],
color: InkingControl.Instance.selectedColor,
width: InkingControl.Instance.selectedWidth,
- tool: InkingControl.Instance.selectedTool
+ tool: InkingControl.Instance.selectedTool,
+ page: this.props.Document.GetNumber(KeyStore.CurPage, 0)
});
this.inkData = data;
this._isDrawing = true;
@@ -137,15 +138,17 @@ export class InkingCanvas extends React.Component<InkCanvasProps> {
// parse data from server
let paths: Array<JSX.Element> = []
+ let curPage = this.props.Document.GetNumber(KeyStore.CurPage, 0)
Array.from(lines).map(item => {
let id = item[0];
let strokeData = item[1];
- paths.push(<InkingStroke key={id} id={id}
- line={strokeData.pathData}
- color={strokeData.color}
- width={strokeData.width}
- tool={strokeData.tool}
- deleteCallback={this.removeLine} />)
+ if (strokeData.page == 0 || strokeData.page == curPage)
+ paths.push(<InkingStroke key={id} id={id}
+ line={strokeData.pathData}
+ color={strokeData.color}
+ width={strokeData.width}
+ tool={strokeData.tool}
+ deleteCallback={this.removeLine} />)
})
return (