mirror of
https://github.com/enso-org/enso.git
synced 2024-11-23 08:08:34 +03:00
Fix Scroll Area demo scene (#3261)
Fix the `scroll-area` example scene, so that a red circle inside the scroll area, and a gray rounded rectangle representing the background of the scroll area, are now both visible. Previously, adding just a `Sprite` (instead of a corresponding `SpriteSystem`) to the scene resulted in the underlying `Symbol` not being added to a visible `Layer`. (Notably, `Sprite::display_object()` is not the same as `Sprite::symbol.display_object()`.) https://www.pivotaltracker.com/story/show/180459079
This commit is contained in:
parent
dbcc2548df
commit
8f61ec174e
@ -73,7 +73,7 @@ fn init(app: &Application) {
|
||||
let background_shape = Rect(background_size).corners_radius(5.5.px()).fill(background_color);
|
||||
let background_system = ShapeSystem::new(scene, background_shape);
|
||||
let background: Sprite = background_system.new_instance();
|
||||
scene.add_child(&background);
|
||||
scene.add_child(&background_system);
|
||||
background.size.set(Vector2::new(200.0, 200.0));
|
||||
background.set_position_x(100.0);
|
||||
background.set_position_y(-100.0);
|
||||
@ -93,7 +93,7 @@ fn init(app: &Application) {
|
||||
|
||||
let sprite_system = ShapeSystem::new(scene, &Circle(50.px()));
|
||||
let sprite: Sprite = sprite_system.new_instance();
|
||||
scroll_area.content.add_child(&sprite);
|
||||
scroll_area.content.add_child(&sprite_system);
|
||||
sprite.size.set(Vector2::new(100.0, 100.0));
|
||||
sprite.set_position_x(100.0);
|
||||
sprite.set_position_y(-100.0);
|
||||
|
Loading…
Reference in New Issue
Block a user