aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/GestureOverlay.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-07-08 12:37:06 -0400
committerbobzel <zzzman@gmail.com>2022-07-08 12:37:06 -0400
commit5628b585fa6356d66cf2e7454be20e3b847ad22e (patch)
tree7836fd781c3cd82c00965d22c6bdf325414ef490 /src/client/views/GestureOverlay.tsx
parent146f8622d5bac2edc6b09f57c173bd057dfbcfad (diff)
fixes for drawing ink on pdf/image/etc. fixes for showing contextMenu. moved gestureOverlay into main dashboard area to avoid drawing on UI widgets. more code cleanup to put things in reasonable places and avoid importing too much stuff.
Diffstat (limited to 'src/client/views/GestureOverlay.tsx')
-rw-r--r--src/client/views/GestureOverlay.tsx20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/client/views/GestureOverlay.tsx b/src/client/views/GestureOverlay.tsx
index 5a68e9091..5ec4de953 100644
--- a/src/client/views/GestureOverlay.tsx
+++ b/src/client/views/GestureOverlay.tsx
@@ -582,13 +582,15 @@ export class GestureOverlay extends Touchable {
})
);
}
- if (InteractionUtils.IsType(e, InteractionUtils.PENTYPE) || [InkTool.Highlighter, InkTool.Pen, InkTool.Write].includes(Doc.ActiveTool)) {
- if (InteractionUtils.IsType(e, InteractionUtils.PENTYPE)) {
- Doc.ActiveTool = InkTool.Write;
+ if (!(e.target as any)?.className?.startsWith('lm_')) {
+ if (InteractionUtils.IsType(e, InteractionUtils.PENTYPE) || [InkTool.Highlighter, InkTool.Pen, InkTool.Write].includes(Doc.ActiveTool)) {
+ if (InteractionUtils.IsType(e, InteractionUtils.PENTYPE)) {
+ Doc.ActiveTool = InkTool.Write;
+ }
+ this._points.push({ X: e.clientX, Y: e.clientY });
+ setupMoveUpEvents(this, e, this.onPointerMove, this.onPointerUp, emptyFunction);
+ // if (Doc.ActiveTool === InkTool.Highlighter) SetActiveInkColor("rgba(245, 230, 95, 0.75)");
}
- this._points.push({ X: e.clientX, Y: e.clientY });
- setupMoveUpEvents(this, e, this.onPointerMove, this.onPointerUp, emptyFunction);
- // if (Doc.ActiveTool === InkTool.Highlighter) SetActiveInkColor("rgba(245, 230, 95, 0.75)");
}
};
@@ -965,7 +967,7 @@ export class GestureOverlay extends Touchable {
this._strokes.map((l, i) => {
const b = { left: -20000, right: 20000, top: -20000, bottom: 20000, width: 40000, height: 40000 }; //this.getBounds(l, true);
return (
- <svg key={i} width={b.width} height={b.height} style={{ transform: `translate(${b.left}px, ${b.top}px)`, pointerEvents: 'none', position: 'absolute', zIndex: 30000, overflow: 'visible' }}>
+ <svg key={i} width={b.width} height={b.height} style={{ top: 0, left: 0, transform: `translate(${b.left}px, ${b.top}px)`, pointerEvents: 'none', position: 'absolute', zIndex: 30000, overflow: 'visible' }}>
{InteractionUtils.CreatePolyline(
l,
b.left,
@@ -992,9 +994,9 @@ export class GestureOverlay extends Touchable {
);
}),
this._points.length <= 1 ? null : (
- <svg key="svg" width={B.width} height={B.height} style={{ transform: `translate(${B.left}px, ${B.top}px)`, pointerEvents: 'none', position: 'absolute', zIndex: 30000, overflow: 'visible' }}>
+ <svg key="svg" width={B.width} height={B.height} style={{ top: 0, left: 0, transform: `translate(${B.left}px, ${B.top}px)`, pointerEvents: 'none', position: 'absolute', zIndex: 30000, overflow: 'visible' }}>
{InteractionUtils.CreatePolyline(
- this._points.map(p => ({ X: p.X, Y: p.Y - (rect?.y || 0) })),
+ this._points.map(p => ({ X: p.X - (rect?.x || 0), Y: p.Y - (rect?.y || 0) })),
B.left,
B.top,
ActiveInkColor(),