You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve the definition of CanvasLayer#name to always provide the root class name for a certain layer type as the immediate child of layerOptions.baseClass
#8921
Closed
1 of 6 tasks
stwlam opened this issue
Feb 21, 2023
· 0 comments
stwlam opened this issue
Feb 21, 2023
· 0 comments
Assignees
Labels
apiIssues related to the API used by Mod DevsbugFunctionality which is not working as intendedcanvasIssues related to the PIXI canvas, rendering, and other WebGL functions.
/** * The canonical name of the CanvasLayer * @type {string} */getname(){returnthis.constructor.name;}
That it is called a "canonical" name suggests the getter was intended to be more than just a shortcut to somelayer.constructor.name. Some module authors have been surprised to learn that that is what they're actually getting.
What ways of accessing Foundry can you encounter this issue in?
Native App (Electron)
Chrome
Firefox
Safari
Other
Reproduction Steps
Call canvas.tokens.name in a system that registers a subclass for that layer.
What core version are you reporting this for?
10.291
Relevant log output
No response
Bug Checklist
The issue occurs while all Modules are disabled
The text was updated successfully, but these errors were encountered:
aaclayton
added
api
Issues related to the API used by Mod Devs
canvas
Issues related to the PIXI canvas, rendering, and other WebGL functions.
labels
Feb 22, 2023
aaclayton
changed the title
CanvasLayer returns a constructor name as the "canonical" name for a given layer
Improve the definition of CanvasLayer#name to always provide the root class name for a certain layer type as the immediate child of layerOptions.baseClass
Mar 22, 2023
apiIssues related to the API used by Mod DevsbugFunctionality which is not working as intendedcanvasIssues related to the PIXI canvas, rendering, and other WebGL functions.
Implemented Feature
Each
CanvasLayer
subclass now returns a.name
which can be treated as "canonical" for that layer as intended by the original design. Example usages:Original Request
What happened?
That it is called a "canonical" name suggests the getter was intended to be more than just a shortcut to
somelayer.constructor.name
. Some module authors have been surprised to learn that that is what they're actually getting.What ways of accessing Foundry can you encounter this issue in?
Reproduction Steps
Call
canvas.tokens.name
in a system that registers a subclass for that layer.What core version are you reporting this for?
10.291
Relevant log output
No response
Bug Checklist
The text was updated successfully, but these errors were encountered: