aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MainView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-06-23 13:26:59 -0400
committerbobzel <zzzman@gmail.com>2025-06-23 13:26:59 -0400
commit35bd9e51f7cef551382025a5459d68eddd8f028b (patch)
tree8edab8e8e283d06bdeba632959fd51e1488c4af5 /src/client/views/MainView.tsx
parente7a96fa043cfc9c3c426e09bbef42c8df88a45f6 (diff)
fixed invalidations to not trigger creating new refs when ref= was assigned to an anonymous function. fixed scribble erase to not delete everything it overlaps, just things it intersects with or contains. fixed ink to have a Math mode and fixed math recognition myscript calls.
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r--src/client/views/MainView.tsx36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 13b14617c..867a5a304 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -921,19 +921,19 @@ export class MainView extends ObservableReactComponent<object> {
);
}
+ setMainDashRef = (r: HTMLDivElement | null) =>
+ r &&
+ new ResizeObserver(
+ action(() => {
+ this._dashUIWidth = r.getBoundingClientRect().width;
+ this._dashUIHeight = r.getBoundingClientRect().height;
+ })
+ ).observe(r);
@computed get mainDashboardArea() {
return !this.userDoc ? null : (
<div
className="mainView-dashboardArea"
- ref={r => {
- r &&
- new ResizeObserver(
- action(() => {
- this._dashUIWidth = r.getBoundingClientRect().width;
- this._dashUIHeight = r.getBoundingClientRect().height;
- })
- ).observe(r);
- }}
+ ref={this.setMainDashRef}
style={{
color: 'black',
height: `calc(100% - ${this.topOfDashUI + this.topMenuHeight()}px)`,
@@ -1072,6 +1072,14 @@ export class MainView extends ObservableReactComponent<object> {
};
lightboxMaxBorder = [200, 50];
+ setMainViewRef = (r: HTMLDivElement | null) =>
+ r &&
+ new ResizeObserver(
+ action(() => {
+ this._windowWidth = r.getBoundingClientRect().width;
+ this._windowHeight = r.getBoundingClientRect().height;
+ })
+ ).observe(r);
render() {
return (
<div
@@ -1085,15 +1093,7 @@ export class MainView extends ObservableReactComponent<object> {
ele.scrollTop = ele.scrollLeft = 0;
})(document.getElementById('root')!)
}
- ref={r => {
- r &&
- new ResizeObserver(
- action(() => {
- this._windowWidth = r.getBoundingClientRect().width;
- this._windowHeight = r.getBoundingClientRect().height;
- })
- ).observe(r);
- }}>
+ ref={this.setMainViewRef}>
{this.inkResources}
<DictationOverlay />
<SharingManager />