-
Notifications
You must be signed in to change notification settings - Fork 274
Description
Describe the Bug
setTokenImage can break the token footprint.
If I set a token as freesize, size the token the way I want. If I change the image of the token, overwrites my manual setting and changes the footprint to match the image size.
If you change a token to freesize, it should retain the size it was initially set at and not change the token footprint based off the image size.
To Reproduce
Open a new campaign.
Make sure the default preferences for object, is Start Freesize is checked.
Drag a token to the object layer and size the token.
Use setTokenImage to change the tokens images to a smaller image.
The token foot print conform to the image, and break the token footprint away from you set it at.
Expected Behaviour
Token footprints should never dynamically change without specific instruction from someone. setTokenHeight, setTokenWidth, mouse-down drag the sizer, token properties panel, etc should be the only viable methods to change the token footprint.
Screenshots
setTokenImage-ObjectLayer.mp4
MapTool Info
1.15.x - current (likely always been this way)
Desktop
Win 11
Additional Context
These lines (1282-1283) in token.java seem to be the root cause of the issue I described above:
public void setImageAsset(String name, MD5Key assetId)
{
imageAssetMap.put(name, assetId);
BufferedImage image = ImageManager.getImageAndWait(assetId);
setWidth(image.getWidth(null));
setHeight(image.getHeight(null));
}
In my simple testing, removing these resolved the issue and may resolve this one too:2195