From 381a2b87a7dd9d6e3629d89dec692a8e5d9d0662 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Thu, 25 Jun 2020 16:44:52 -0500 Subject: slight fix to zooming w menu --- src/client/views/collections/CollectionSchemaView.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') 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 (
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)` }}> { const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height); -- cgit v1.2.3-70-g09d2