Skip to content

Unable to add Text to Group #148

@VesselWave

Description

@VesselWave

Describe the bug
Adding Text to Group breaks it. Not only text can't be seen, but other objects in the group also disappear. However, if you create a group with text in one function, it works.

To Reproduce
Steps to reproduce the behavior:

  1. Go to CodeHS sandbox with JavaScript Graphics
  2. Put this code
// const group = new Group(new Text("abc123"));
var group = new Group();
group.add(new Text("abc123"));

group.add(new Circle(5));
group.setPosition(0, 0);
add(group);
  1. Run it. You won't see a circle or a text.
  2. Try commenting out line 1 and commenting lines 2 and 3. You will see a small circle and a text

Expected behavior
A circle and a text visible in both cases

Screenshots
They are seen only in second case

Desktop

  • OS: Windows 10
  • Browser Firefox
  • Version 110

AND

Desktop

  • OS: Chrome OS
  • Browser Chrome
  • Version 107

Additional context
If you create a group with text in one function, it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions