aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SnappingManager.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-04-21 13:48:58 -0400
committerbobzel <zzzman@gmail.com>2025-04-21 13:48:58 -0400
commit17e24e780b54f2f7015c0ca955c3aa5091bba19c (patch)
treeb13002c92d58cb52a02b46e4e1d578f1d57125f2 /src/client/util/SnappingManager.ts
parent22a40443193320487c27ce02bd3f134d13cb7d65 (diff)
parent1f294ef4a171eec72a069a9503629eaf7975d983 (diff)
merged with master and cleaned up outpainting a bit.
Diffstat (limited to 'src/client/util/SnappingManager.ts')
-rw-r--r--src/client/util/SnappingManager.ts54
1 files changed, 30 insertions, 24 deletions
diff --git a/src/client/util/SnappingManager.ts b/src/client/util/SnappingManager.ts
index 3bbc297b8..54c91087f 100644
--- a/src/client/util/SnappingManager.ts
+++ b/src/client/util/SnappingManager.ts
@@ -1,4 +1,4 @@
-import { observable, action, runInAction, makeObservable } from 'mobx';
+import { observable, action, makeObservable } from 'mobx';
import { Gestures } from '../../pen-gestures/GestureTypes';
export enum freeformScrollMode {
@@ -34,6 +34,9 @@ export class SnappingManager {
@observable _keepGestureMode: boolean = false; // for whether primitive selection enters a one-shot or persistent mode
@observable _inkShape: Gestures | undefined = undefined;
@observable _chatVisible: boolean = false;
+ @observable _userBackgroundColor: string | undefined = undefined;
+ @observable _userVariantColor: string | undefined = undefined;
+ @observable _userColor: string | undefined = undefined;
private constructor() {
SnappingManager._manager = this;
@@ -48,6 +51,9 @@ export class SnappingManager {
this.Instance._vertSnapLines.push(...vertLines);
};
+ public static get userBackgroundColor() { return this.Instance._userBackgroundColor; } // prettier-ignore
+ public static get userVariantColor() { return this.Instance._userVariantColor; } // prettier-ignore
+ public static get userColor() { return this.Instance._userColor; } // prettier-ignore
public static get HorizSnapLines() { return this.Instance._horizSnapLines; } // prettier-ignore
public static get VertSnapLines() { return this.Instance._vertSnapLines; } // prettier-ignore
public static get LongPress() { return this.Instance._longPress; } // prettier-ignore
@@ -71,29 +77,29 @@ export class SnappingManager {
public static get InkShape() { return this.Instance._inkShape; } // prettier-ignore
public static get ChatVisible() { return this.Instance._chatVisible; } // prettier-ignore
- public static SetLongPress = (press: boolean) => runInAction(() => {this.Instance._longPress = press}); // prettier-ignore
- public static SetShiftKey = (down: boolean) => runInAction(() => {this.Instance._shiftKey = down}); // prettier-ignore
- public static SetCtrlKey = (down: boolean) => runInAction(() => {this.Instance._ctrlKey = down}); // prettier-ignore
- public static SetMetaKey = (down: boolean) => runInAction(() => {this.Instance._metaKey = down}); // prettier-ignore
- public static SetHideUI = (vis: boolean) => runInAction(() => {this.Instance._hideUI = vis}); // prettier-ignore
- public static SetShowPresPaths = (paths:boolean) => runInAction(() => {this.Instance._showPresPaths = paths}); // prettier-ignore
- public static SetIsLinkFollowing= (follow:boolean)=> runInAction(() => {this.Instance._isLinkFollowing = follow}); // prettier-ignore
- public static SetIsDragging = (drag: boolean) => runInAction(() => {this.Instance._isDragging = drag}); // prettier-ignore
- public static SetIsResizing = (docid?:string) => runInAction(() => {this.Instance._isResizing = docid}); // prettier-ignore
- public static SetCanEmbed = (embed:boolean) => runInAction(() => {this.Instance._canEmbed = embed}); // prettier-ignore
- public static SetExploreMode = (state:boolean) => runInAction(() => {this.Instance._exploreMode = state}); // prettier-ignore
- public static TriggerUserPanned = () => runInAction(() => {this.Instance._userPanned = !this.Instance._userPanned}); // prettier-ignore
- public static SetServerVersion = (version:string) =>runInAction(() => {this.Instance._serverVersion = version}); // prettier-ignore
- public static SetLastPressedBtn = (id:string) =>runInAction(() => {this.Instance._lastBtnId = id}); // prettier-ignore
- public static SetPropertiesWidth= (wid:number) =>runInAction(() => {this.Instance._propertyWid = wid}); // prettier-ignore
- public static SetPrintToConsole = (state:boolean) =>runInAction(() => {this.Instance._printToConsole = state}); // prettier-ignore
- public static SetHideDecorations= (state:boolean) =>runInAction(() => {this.Instance._hideDecorations = state}); // prettier-ignore
- public static SetKeepGestureMode= (state:boolean) =>runInAction(() => {this.Instance._keepGestureMode = state}); // prettier-ignore
- public static SetInkShape = (shape?:Gestures)=>runInAction(() => {this.Instance._inkShape = shape}); // prettier-ignore
- public static SetChatVisible = (vis:boolean) =>runInAction(() => {this.Instance._chatVisible = vis}); // prettier-ignore
+ public static SetUserBackgroundColor = action((color: string) => (this.Instance._userBackgroundColor = color)); // prettier-ignore
+ public static SetUserVariantColor = action((color: string) => (this.Instance._userVariantColor = color)); // prettier-ignore
+ public static SetUserColor = action((color: string) => (this.Instance._userColor = color)); // prettier-ignore
+ public static SetLongPress = action((press: boolean)=> (this.Instance._longPress = press)); // prettier-ignore
+ public static SetShiftKey = action((down: boolean) => (this.Instance._shiftKey = down)); // prettier-ignore
+ public static SetCtrlKey = action((down: boolean) => (this.Instance._ctrlKey = down)); // prettier-ignore
+ public static SetMetaKey = action((down: boolean) => (this.Instance._metaKey = down)); // prettier-ignore
+ public static SetHideUI = action((vis: boolean) => (this.Instance._hideUI = vis)); // prettier-ignore
+ public static SetShowPresPaths = action((paths:boolean) => (this.Instance._showPresPaths = paths)); // prettier-ignore
+ public static SetIsLinkFollowing = action((follow:boolean)=> (this.Instance._isLinkFollowing = follow)); // prettier-ignore
+ public static SetIsDragging = action((drag: boolean) => (this.Instance._isDragging = drag)); // prettier-ignore
+ public static SetIsResizing = action((docid?:string) => (this.Instance._isResizing = docid)); // prettier-ignore
+ public static SetCanEmbed = action((embed:boolean) => (this.Instance._canEmbed = embed)); // prettier-ignore
+ public static SetExploreMode = action((state:boolean) => (this.Instance._exploreMode = state)); // prettier-ignore
+ public static TriggerUserPanned = action(() => (this.Instance._userPanned = !this.Instance._userPanned)); // prettier-ignore
+ public static SetServerVersion = action((version:string)=> (this.Instance._serverVersion = version)); // prettier-ignore
+ public static SetLastPressedBtn = action((id:string) => (this.Instance._lastBtnId = id)); // prettier-ignore
+ public static SetPropertiesWidth = action((wid:number) => (this.Instance._propertyWid = wid)); // prettier-ignore
+ public static SetPrintToConsole = action((state:boolean) => (this.Instance._printToConsole = state)); // prettier-ignore
+ public static SetHideDecorations = action((state:boolean) => (this.Instance._hideDecorations = state)); // prettier-ignore
+ public static SetKeepGestureMode = action((state:boolean) => (this.Instance._keepGestureMode = state)); // prettier-ignore
+ public static SetInkShape = action((shape?:Gestures)=>(this.Instance._inkShape = shape)); // prettier-ignore
+ public static SetChatVisible = action((vis:boolean) => (this.Instance._chatVisible = vis)); // prettier-ignore
- public static userColor: string | undefined;
- public static userVariantColor: string | undefined;
- public static userBackgroundColor: string | undefined;
public static SettingsStyle: CSSStyleSheet | null;
}