diff options
| author | bobzel <zzzman@gmail.com> | 2024-11-12 18:03:12 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-11-12 18:03:12 -0500 |
| commit | 6a6215a447c3104f5fea8a813270b8c1fc39ad75 (patch) | |
| tree | f707076e558181426616a03858d01af27192bfc1 /src/client/views/DocumentDecorations.tsx | |
| parent | 8680d1c31d4f835663c070f5b8cef57254e75e28 (diff) | |
fixed resizing height to 0 to autoResize. fixed setting background color default for equations (and everything else) to textBackgroundColor from user doc. Added a math pseudo-font to trigger entering equations instead of rich text.
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
| -rw-r--r-- | src/client/views/DocumentDecorations.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 492c2bda1..07e362672 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -506,7 +506,7 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora // determines how much to resize, and determines the resize reference point // getResizeVals = (thisPt: { x: number; y: number }, dragHdl: string) => { - const [w, h] = [this.Bounds.r - this.Bounds.x, this.Bounds.b - this.Bounds.y]; + const [w, h] = [Math.max(1, this.Bounds.r - this.Bounds.x), Math.max(1, this.Bounds.b - this.Bounds.y)]; const [moveX, moveY] = [thisPt.x - this._snapPt.x, thisPt.y - this._snapPt.y]; switch (dragHdl) { case 'topLeft': return { scale: { x: 1 - moveX / w, y: 1 -moveY / h }, refPt: [this.Bounds.r, this.Bounds.b] }; @@ -566,8 +566,8 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora } doc._width = Math.max(NumCast(doc._width_min, 25), NumCast(doc._width) * scale.x); - doc._height = Math.max(NumCast(doc._height_min, 25), NumCast(doc._height) * scale.y); - const { deltaX, deltaY } = this.realignRefPt(doc, refCent, initWidth, initHeight); + doc._height = Math.max(NumCast(doc._height_min), NumCast(doc._height) * scale.y); + const { deltaX, deltaY } = this.realignRefPt(doc, refCent, initWidth || 1, initHeight || 1); doc.x = NumCast(doc.x) + deltaX; doc.y = NumCast(doc.y) + deltaY; |
