Skip to content

Line width and height aren't updated after setTo() #7270

Closed

Description

@samme

Version

  • Phaser Version: 3.90.0, 4.0.0 RC7

Description

Create a new Line Game Object. The width and height are correct, equal to the horizontal and vertical lengths. Call setTo(), changing the endpoint coordinates. The width and height are incorrect (unchanged).

Example Test Code

const line = new Phaser.GameObjects.Line(
    { sys: { queueDepthSort: function () {} } },
    0, 0,
    0, 0,
    1, 2
);

console.info('4 assertions should pass …');

console.assert(line.width === 1, 'Initial width should be 1');
console.assert(line.height === 2, 'Initial height should be 2');

line.setTo(100, 100, 103, 105);

console.assert(line.width === 3, 'Width after setTo() should be 3');
console.assert(line.height === 5, 'Height after setTo() should be 5');

console.info('Done');

Additional Information

Add private updateSize().

Activity

  1. livbell1231-create commented on Mar 31, 2026

    @livbell1231-create
  2. added a commit that references this issue on Jun 19, 2026
    ed84998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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