diff options
| author | bobzel <zzzman@gmail.com> | 2023-12-29 17:01:40 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2023-12-29 17:01:40 -0500 |
| commit | 9b9f54a43793ca6ffb26c56f962d11ba8325abd2 (patch) | |
| tree | 026063b95da59556eb0a416b5f6fafd2ebccd737 /src/client/views/DocumentDecorations.tsx | |
| parent | a567eb1b6469db202d41d4d54f2c96137e49ea9c (diff) | |
cleaned up imports, mobx observable initialization and some compile errors.
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
| -rw-r--r-- | src/client/views/DocumentDecorations.tsx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index d2f23c2f3..dab6e6193 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -12,7 +12,7 @@ import { RichTextField } from '../../fields/RichTextField'; import { ScriptField } from '../../fields/ScriptField'; import { BoolCast, Cast, DocCast, NumCast, StrCast } from '../../fields/Types'; import { GetEffectiveAcl } from '../../fields/util'; -import { emptyFunction, numberValue, returnFalse, setupMoveUpEvents, Utils } from '../../Utils'; +import { emptyFunction, lightOrDark, numberValue, returnFalse, setupMoveUpEvents, Utils } from '../../Utils'; import { Docs } from '../documents/Documents'; import { DocumentType } from '../documents/DocumentTypes'; import { DocumentManager } from '../util/DocumentManager'; @@ -85,7 +85,7 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora } @computed get ClippedBounds() { - const bounds = this.Bounds; + const bounds = { ...this.Bounds }; const leftBounds = this._props.boundsLeft; const topBounds = LightboxView.LightboxDoc ? 0 : this._props.boundsTop; bounds.x = Math.max(leftBounds, bounds.x - this._resizeBorderWidth / 2) + this._resizeBorderWidth / 2; @@ -106,9 +106,8 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora : { x: Math.min(rect.left, bounds.x), y: Math.min(rect.top, bounds.y), r: Math.max(rect.right, bounds.r), - b: Math.max(rect.bottom, bounds.b), - c: SelectionManager.Views.length === 1 ? rect.center : undefined }, - { x: Number.MAX_VALUE, y: Number.MAX_VALUE, r: Number.MIN_VALUE, b: Number.MIN_VALUE, c: undefined as { X: number; Y: number } | undefined }); // prettier-ignore + b: Math.max(rect.bottom, bounds.b)}, + { x: Number.MAX_VALUE, y: Number.MAX_VALUE, r: Number.MIN_VALUE, b: Number.MIN_VALUE }); // prettier-ignore } @action @@ -811,7 +810,7 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora <div className="documentDecorations-borderRadius" style={{ - background: `${this._isRounding ? Colors.MEDIUM_BLUE : SettingsManager.userColor}`, + background: `${this._isRounding ? Colors.MEDIUM_BLUE : lightOrDark(StrCast(seldocview.layoutDoc._backgroundColor, SettingsManager.userColor))}`, transform: `translate(${radiusHandleLocation ?? 0}px, ${(radiusHandleLocation ?? 0) + (this._showNothing ? 0 : this._titleHeight)}px)`, }} onPointerDown={this.onRadiusDown} |
