Skip to content

Bundles don't update instantaneously #632

Description

@hallpell

This isn't a huge issue and shouldn't come up in most scenarios.

The scenario I can come up with that could cause issues is:

  • Update offsetX for a component sprite
  • Immediately read that component's x position. This will not be updated, since the x position doesn't get updated based on the offsetX until the bundle runs arrangeComponents(), which is usually called in _render() when we redraw the screen (at the end of each forever loop).

While not great, I'm inclined not to fix/change this - it's something that should be addressed if Bundles become student-facing, but I don't think that they ever will/should be.

Fixing this would likely look like having the component sprites have Object.defineProperty for their offsets that make the parent Bundle call arrangeComponents() each time they are changed. This would also need a separate (intended to be private) offset variable inside each component sprite, which would probably be fine but is another reason I'm reluctant to do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions