diff --git a/app/gui/view/graph-editor/src/builtin/visualization/native/text_visualization.rs b/app/gui/view/graph-editor/src/builtin/visualization/native/text_visualization.rs index f99e2fd92cb..93e6d2551ae 100644 --- a/app/gui/view/graph-editor/src/builtin/visualization/native/text_visualization.rs +++ b/app/gui/view/graph-editor/src/builtin/visualization/native/text_visualization.rs @@ -42,7 +42,8 @@ use ensogl_component::grid_view::GridView; use ensogl_component::scrollbar; use ensogl_component::scrollbar::Scrollbar; use ensogl_hardcoded_theme as theme; - +use text_provider::BackendTextProvider; +use text_provider::TextProvider; // ================= @@ -80,9 +81,6 @@ pub struct GridWindow { size: GridSize, } -use text_provider::BackendTextProvider; -use text_provider::TextProvider; - // ============= @@ -164,19 +162,16 @@ impl Model { self.root.add_child(&self.scroll_bar_horizontal); self.root.add_child(&self.scroll_bar_vertical); self.scroll_bar_vertical.set_rotation_z(-90.0_f32.to_radians()); - - self.app.display.default_scene.layers.main.add(&self.scroll_bar_horizontal); - self.app.display.default_scene.layers.main.add(&self.scroll_bar_vertical); } fn set_size(&self, size: Vector2) { - self.scroll_bar_horizontal.set_y(-size.y / 2.0); - self.scroll_bar_horizontal.set_length(size.x); let scrollbar_width = scrollbar::WIDTH - scrollbar::PADDING; - self.scroll_bar_horizontal.modify_y(|y| *y += scrollbar_width / 2.0); - self.scroll_bar_vertical.set_x(size.x / 2.0); + let h_y = -size.y / 2.0 + scrollbar_width / 2.0; + self.scroll_bar_horizontal.set_y(h_y); + self.scroll_bar_horizontal.set_length(size.x); + let v_x = size.x / 2.0 - scrollbar_width / 2.0; + self.scroll_bar_vertical.set_x(v_x); self.scroll_bar_vertical.set_length(size.y); - self.scroll_bar_vertical.modify_x(|x| *x -= scrollbar_width / 2.0); let text_padding = Vector2::new(PADDING_TEXT, PADDING_TEXT); self.clipping_div.set_dom_size(size - 2.0 * text_padding); self.size.set(size); diff --git a/app/gui/view/graph-editor/src/component/visualization/container.rs b/app/gui/view/graph-editor/src/component/visualization/container.rs index d7ebb3da0c2..9628eef12c4 100644 --- a/app/gui/view/graph-editor/src/component/visualization/container.rs +++ b/app/gui/view/graph-editor/src/component/visualization/container.rs @@ -353,6 +353,7 @@ impl ContainerModel { fn init(self) -> Self { self.display_object.add_child(&self.drag_root); self.scene.layers.above_nodes.add(&self.action_bar); + self.scene.layers.panel.add(&self.fullscreen_view); self.update_shape_sizes(ViewState::default()); self.init_corner_roundness(); self.view.show_waiting_screen();