From 35bd9e51f7cef551382025a5459d68eddd8f028b Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 23 Jun 2025 13:26:59 -0400 Subject: 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. --- src/client/views/MainView.tsx | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/client/views/MainView.tsx') 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 { ); } + 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 : (
{ - 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 { }; 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 (
{ 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} -- cgit v1.2.3-70-g09d2