From 943e56ceb0c8103b3672b088228b2c517eccc240 Mon Sep 17 00:00:00 2001 From: Michael Mauderer Date: Mon, 1 May 2023 13:25:25 +0100 Subject: [PATCH 1/4] Disregard visualisation for selection of nodes. --- app/gui/view/graph-editor/src/component/node.rs | 12 ++++++++---- app/gui/view/graph-editor/src/selection.rs | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/gui/view/graph-editor/src/component/node.rs b/app/gui/view/graph-editor/src/component/node.rs index ee555fd05b96..3277740e0574 100644 --- a/app/gui/view/graph-editor/src/component/node.rs +++ b/app/gui/view/graph-editor/src/component/node.rs @@ -373,6 +373,8 @@ ensogl::define_endpoints_2! { /// [`visualization_visible`] is updated. Please remember, that the [`position`] is not /// immediately updated, only during the Display Object hierarchy update bounding_box (BoundingBox), + /// The bounding box of the node without the visualization. + inner_bounding_box (BoundingBox), /// A set of widgets attached to a method requires metadata to be queried. The tuple /// contains the ID of the call expression the widget is attached to, and the ID of that /// call's target expression (`self` or first argument). @@ -1009,7 +1011,10 @@ impl Node { visualization_enabled_and_visible <- visualization_enabled && visualization_visible; bbox_input <- all4( &out.position,&new_size,&visualization_enabled_and_visible,visualization_size); - out.bounding_box <+ bbox_input.map(|(a,b,c,d)| bounding_box(*a,*b,*c,*d)); + out.bounding_box <+ bbox_input.map(|(a,b,c,d)| bounding_box(*a,*b,c.then(|| *d))); + + inner_bbox_input <- all2(&out.position,&new_size); + out.inner_bounding_box <+ inner_bbox_input.map(|(a,b)| bounding_box(*a,*b,None)); // === VCS Handling === @@ -1069,13 +1074,12 @@ fn visualization_offset(node_width: f32) -> Vector2 { fn bounding_box( node_position: Vector2, node_size: Vector2, - visualization_enabled_and_visible: bool, - visualization_size: Vector2, + visualization_size: Option, ) -> BoundingBox { let x_offset_to_node_center = x_offset_to_node_center(node_size.x); let node_bbox_pos = node_position + Vector2(x_offset_to_node_center, 0.0) - node_size / 2.0; let node_bbox = BoundingBox::from_position_and_size(node_bbox_pos, node_size); - if visualization_enabled_and_visible { + if let Some(visualization_size) = visualization_size { let visualization_offset = visualization_offset(node_size.x); let visualization_pos = node_position + visualization_offset; let visualization_bbox_pos = visualization_pos - visualization_size / 2.0; diff --git a/app/gui/view/graph-editor/src/selection.rs b/app/gui/view/graph-editor/src/selection.rs index 2528f25e9591..b59724cf3925 100644 --- a/app/gui/view/graph-editor/src/selection.rs +++ b/app/gui/view/graph-editor/src/selection.rs @@ -235,7 +235,7 @@ fn get_nodes_in_bounding_box(bounding_box: &BoundingBox, nodes: &Nodes) -> Vec Date: Mon, 1 May 2023 13:30:26 +0100 Subject: [PATCH 2/4] Update CHANGELOG.md. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e64c5e290ff..c907f0913e5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -136,6 +136,8 @@ such as dropdown can now be placed in the node and affect the code text flow. - [The IDE UI element for selecting the execution mode of the project is now sending messages to the backend.][6341]. +- [Area selectionof nodes no longer takes into account the visualisation that + belongs to the node.][6487]. #### EnsoGL (rendering engine) @@ -199,6 +201,7 @@ [6035]: https://github.com/enso-org/enso/pull/6035 [6097]: https://github.com/enso-org/enso/pull/6097 [6097]: https://github.com/enso-org/enso/pull/6341 +[6487]: https://github.com/enso-org/enso/pull/6487 #### Enso Standard Library From 2bc96f3367f10803882572e036bfa48c2b7a17af Mon Sep 17 00:00:00 2001 From: Michael Mauderer Date: Mon, 1 May 2023 13:30:58 +0100 Subject: [PATCH 3/4] Fmt. --- app/gui/view/graph-editor/src/component/node.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/gui/view/graph-editor/src/component/node.rs b/app/gui/view/graph-editor/src/component/node.rs index 3277740e0574..98eeb2ad7809 100644 --- a/app/gui/view/graph-editor/src/component/node.rs +++ b/app/gui/view/graph-editor/src/component/node.rs @@ -374,7 +374,7 @@ ensogl::define_endpoints_2! { /// immediately updated, only during the Display Object hierarchy update bounding_box (BoundingBox), /// The bounding box of the node without the visualization. - inner_bounding_box (BoundingBox), + inner_bounding_box (BoundingBox), /// A set of widgets attached to a method requires metadata to be queried. The tuple /// contains the ID of the call expression the widget is attached to, and the ID of that /// call's target expression (`self` or first argument). From b02543408a1bf429abbdf65e0c148f990b1de30d Mon Sep 17 00:00:00 2001 From: Michael Mauderer Date: Thu, 4 May 2023 15:05:45 +0100 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23838ffb3102..4e176a7197a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -138,7 +138,6 @@ sending messages to the backend.][6341]. - [Area selectionof nodes no longer takes into account the visualisation that belongs to the node.][6487]. - sending messages to the backend][6341]. - [List Editor Widget][6470]. Now you can edit lists by clicking buttons on nodes or by dragging the elements. - [Fixed text visualisations which were being cut off at the last line.][6421]