Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EaselJS app with Require, getBounds() returns null.

See original GitHub issue

I have some text created like this:

dialogText = new createjs.Text(text, 'bold ' + (28 * scale) + 'px Calibri', '#FFFFFF');

Then later on I use dialogText.getBounds() which returns null.

I try console logging dialogText and I can see that it is set and there is a value _bounds which reads null.

When I use the same javascript without requirejs it seems to work fine.

Any tips of what might be causing my issue?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

MannyCcommented, Feb 15, 2017

Your dialogText has no text in it, so it’s returning null for getBounds()

kirkinscommented, Feb 15, 2017

@MannyC wow thanks so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

createjs - Why does easeljs stage.getBounds() return null?
It looks like the stage object can't calculate their own bounds. In the same getBounds() documentation it appears the following:.
Read more >
EaselJS v1.0.0 API Documentation : DisplayObject - CreateJS
DisplayObject is the base class for all display classes in the EaselJS library. ... draw; getBounds; getCacheDataURL; getConcatenatedDisplayProps ...
Read more >
EaselJS v1.0.0 API Documentation : Container - CreateJS
A Container is a nestable display list that allows you to work with compound display elements. For example you could group arm, leg,...
Read more >
EaselJS v1.0.0 API Documentation : Stage - CreateJS
A stage is the root level Container for a display list. Each time its tick method is called, it will render its display...
Read more >
easeljs/display/DisplayObject.js - CreateJS
cacheCanvas = null;; /**; * If a cache has been made, this returns the class ... containing any arguments that were passed to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found