diff options
author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-06-25 16:44:52 -0500 |
---|---|---|
committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-06-25 16:44:52 -0500 |
commit | 381a2b87a7dd9d6e3629d89dec692a8e5d9d0662 (patch) | |
tree | ea9c3e091b60982dd1976eb663488f6f7c5abf14 | |
parent | a1daa25fa9db681774376fe52d62c6b6d5c32a76 (diff) |
slight fix to zooming w menu
-rw-r--r-- | src/client/views/collections/CollectionSchemaView.tsx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx index 2e4d10f1d..128423014 100644 --- a/src/client/views/collections/CollectionSchemaView.tsx +++ b/src/client/views/collections/CollectionSchemaView.tsx @@ -349,13 +349,22 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) { return this.props.ScreenToLocalTransform().translate(- this.borderWidth - NumCast(COLLECTION_BORDER_WIDTH) - this.tableWidth, - this.borderWidth); } + @action + onWheel(e: React.WheelEvent) { + const scale = this.props.ScreenToLocalTransform().Scale; + this.props.active(true) && e.stopPropagation(); + this.menuCoordinates[0] += e.screenX * scale; + this.menuCoordinates[1] += e.screenY * scale; + } + @computed get renderMenu() { + const scale = this.props.ScreenToLocalTransform().Scale; return ( <div className="collectionSchema-header-menu" ref={this.setNode} onWheel={e => this.props.active(true) && e.stopPropagation()} style={{ position: "absolute", background: "white", - transform: `translate(${this.menuCoordinates[0]}px, ${this.menuCoordinates[1]}px)` + transform: `translate(${this.menuCoordinates[0]}px, ${this.menuCoordinates[1] - 100 / scale}px)` }}> <Measure offset onResize={action((r: any) => { const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height); |