Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: rotating an Input causes it and its parent(s) to get Infinity as their global bounds #151

Open
adam-savard opened this issue Apr 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@adam-savard
Copy link

Expected Behavior

The rotation should not cause the bounds to stretch to Infinity

Current Behavior

Setting .rotation on an Input causes input.getBounds() to stretch to Infinity

Possible Solution

Steps to Reproduce

const t = new Input({
      bg: new PIXI.Graphics(),
      placeholder: 'someText',
      value: 'Excellent Text',
      textStyle: {
        fonFamily : 'Arial'
        fill: 0xffffff
      },
      align: 'left',
      maxLength: 255
    })

const c = new Container();
c.addChild(t)

t.rotation += 0.1; //this will cause `c.width` to equal infinity

Environment

  • version: v8.0.4
  • Browser & Version: Chrome 122
  • OS & Version: Fedora 39
@adam-savard adam-savard added the bug Something isn't working label Apr 2, 2024
@adam-savard
Copy link
Author

Hi! Not to be annoying, but I'm noticing that this is still an issue on 2.1.5!

@CyberDex
Copy link
Member

CyberDex commented Oct 17, 2024

Hi, @adam-savard . Unfortunately, I can not reproduce this one. Check this branch: https://github.com/pixijs/ui/tree/151-bug-rotating-an-input-causes-it-and-its-parents-to-get-infinity-as-their-global-bounds

If you clone the repo, switch to this branch, run npm start and navigate to http://localhost:6006/?path=/story/components-input-use-graphics--use-graphics and open the console, you may see the sizes:

Image

The code is here:

console.log(view.width, input.getBounds());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants