diff options
author | bobzel <zzzman@gmail.com> | 2021-01-18 11:29:43 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-01-18 11:29:43 -0500 |
commit | c94a8d93ea7373af54355b5c47bf14a021cf4563 (patch) | |
tree | 11064e9d17ea96b181ecfb0154d83f4a90a5d5f3 /src | |
parent | 46c3885a8c6fee0ed9ac384d0a60716550736970 (diff) |
fixed creating right margins for WebBox's
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/WebBox.tsx | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx index 876243533..4c4f3f15a 100644 --- a/src/client/views/nodes/WebBox.tsx +++ b/src/client/views/nodes/WebBox.tsx @@ -458,7 +458,7 @@ export class WebBox extends ViewBoxAnnotatableComponent<FieldViewProps, WebDocum return (<> <div className={"webBox-cont" + (this.props.isSelected() && Doc.GetSelectedTool() === InkTool.None && !DocumentDecorations.Instance?.Interacting ? "-interactive" : "")} style={{ - width: `${100 / scale}%`, + width: NumCast(this.layoutDoc[this.fieldKey + "-contentWidth"]) || `${100 / scale}%`, height: `${100 / scale}%`, transform: `scale(${scale})` }} @@ -572,18 +572,13 @@ export class WebBox extends ViewBoxAnnotatableComponent<FieldViewProps, WebDocum } else if (this._mainCont.current) { // set marquee x and y positions to the spatially transformed position - const nheight = Doc.NativeHeight(this.Document) || 1; - const nwidth = Doc.NativeWidth(this.Document) || 1; const boundingRect = this._mainCont.current.getBoundingClientRect(); - const boundingHeight = nheight / nwidth * boundingRect.width; this._startX = this._marqueeX = (e.clientX - boundingRect.left) * (this._mainCont.current.offsetWidth / boundingRect.width); this._startY = this._marqueeY = (e.clientY - boundingRect.top) * (this._mainCont.current.offsetHeight / boundingRect.height) + this._mainCont.current.scrollTop; this._marqueeHeight = this._marqueeWidth = 0; this._marqueeing = true; } - document.removeEventListener("pointermove", this.onSelectMove); document.addEventListener("pointermove", this.onSelectMove); - document.removeEventListener("pointerup", this.onSelectEnd); document.addEventListener("pointerup", this.onSelectEnd); } } |