diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/MainOverlayTextBox.tsx | 3 | ||||
-rw-r--r-- | src/client/views/PreviewCursor.tsx | 37 | ||||
-rw-r--r-- | src/server/index.ts | 2 |
3 files changed, 19 insertions, 23 deletions
diff --git a/src/client/views/MainOverlayTextBox.tsx b/src/client/views/MainOverlayTextBox.tsx index f315b6d59..b14a1e0ea 100644 --- a/src/client/views/MainOverlayTextBox.tsx +++ b/src/client/views/MainOverlayTextBox.tsx @@ -60,20 +60,17 @@ export class MainOverlayTextBox extends React.Component<MainOverlayTextBoxProps> return new Transform(-sxf.translateX, -sxf.translateY, 1 / sxf.scale); }; this.setTextDoc(box.props.fieldKey, box.CurrentDiv, xf, BoolCast(box.props.Document.autoHeight, false) || box.props.height === "min-content"); - console.log("makin text doc?") } else { this.TextDoc = undefined; this.TextDataDoc = undefined; this.setTextDoc(); - console.log("deletin text doc?") } }); } @action private setTextDoc(textFieldKey?: string, div?: HTMLDivElement, tx?: () => Transform, autoHeight?: boolean) { - console.log("what is going on") if (this._textTargetDiv) { this._textTargetDiv.style.color = this._textColor; } diff --git a/src/client/views/PreviewCursor.tsx b/src/client/views/PreviewCursor.tsx index 9967e142d..04ec51218 100644 --- a/src/client/views/PreviewCursor.tsx +++ b/src/client/views/PreviewCursor.tsx @@ -26,27 +26,27 @@ export class PreviewCursor extends React.Component<{}> { } paste = (e: ClipboardEvent) => { - console.log(e.clipboardData); - if (e.clipboardData) { - //what needs to be done with this? - console.log(e.clipboardData.getData("text/html")); - // console.log(e.clipboardData.getData("text/csv")); - console.log(e.clipboardData.getData("text/plain")); - console.log(e.clipboardData.getData("image/png")); - console.log(e.clipboardData.getData("image/jpg")); - console.log(e.clipboardData.getData("image/jpeg")); + console.log("pasting") + if (PreviewCursor.Visible) { + console.log("preview is visible") + if (e.clipboardData) { + //what needs to be done with this? + console.log(e.clipboardData.getData("text/html")); + // console.log(e.clipboardData.getData("text/csv")); + console.log(e.clipboardData.getData("text/plain")); + console.log(e.clipboardData.getData("image/png")); + console.log(e.clipboardData.getData("image/jpg")); + console.log(e.clipboardData.getData("image/jpeg")); - if (e.clipboardData.getData("text/plain") !== "") { - let text = e.clipboardData.getData("text/plain"); - let newBox = Docs.Create.TextDocument({ width: 200, height: 100, x: PreviewCursor._clickPoint[0], y: PreviewCursor._clickPoint[1], title: "-typed text-" }); - newBox.proto!.autoHeight = true; - PreviewCursor._addLiveTextDoc(newBox); + // pasting in text + if (e.clipboardData.getData("text/plain") !== "") { + let text = e.clipboardData.getData("text/plain"); + let newBox = Docs.Create.TextDocument({ width: 200, height: 100, x: PreviewCursor._clickPoint[0], y: PreviewCursor._clickPoint[1], title: "-typed text-" }); + newBox.proto!.autoHeight = true; + PreviewCursor._addLiveTextDoc(newBox); + } } } - - // let newBox = Docs.Create.TextDocument({ width: 200, height: 100, x: x, y: y, title: "-typed text-" }); - // newBox.proto!.autoHeight = true; - // this.props.addLiveTextDocument(newBox); } @action @@ -70,7 +70,6 @@ export class PreviewCursor extends React.Component<{}> { } @action public static Show(x: number, y: number, onKeyPress: (e: KeyboardEvent) => void, addLiveText: (doc: Doc) => void) { - console.log("clickpoint setting") this._clickPoint = [x, y]; this._onKeyPress = onKeyPress; this._addLiveTextDoc = addLiveText; diff --git a/src/server/index.ts b/src/server/index.ts index 7a425b60a..eae018f13 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -436,7 +436,7 @@ function LoadPage(file: string, pageNumber: number, res: Response) { console.log(pageNumber); pdf.getPage(pageNumber).then((page: Pdfjs.PDFPageProxy) => { console.log("reading " + page); - let viewport = page.getViewport({ scale: 1 }); + let viewport = page.getViewport(1); let canvasAndContext = factory.create(viewport.width, viewport.height); let renderContext = { canvasContext: canvasAndContext.context, |