xaukael / card-tokens

Drag cards to the canvas
MIT License
0 stars 2 forks source link

The aspect ratio of the card is not respected when placed on the canvas. #15

Closed GabrielOsvair closed 11 months ago

GabrielOsvair commented 11 months ago

It would be nice if the 2:3 aspect ratio was respected, so on a 50ppi grid the size looks good.

image image image

xaukael commented 11 months ago

It should do as in the second image. Maybe system or module interference. Have you tried with no other modules? What system are you using?

token: {
      texture: {src:card.face!=null?card.faces[card.face].img:card.faces[0].img}, 
      height: card.height || game.settings.get("card-tokens", "height"), 
      width: card.width || game.settings.get("card-tokens", "width"),
      texture:{rotation: card.rotation},
      displayName: game.settings.get("card-tokens", "displayName"),
      displayBars: CONST.TOKEN_DISPLAY_MODES.NONE,
      bar1: {attribute: null},
      bar2: {attribute: null}
    },
GabrielOsvair commented 11 months ago

Foundry v11 build 305, D&D 5e v2.2.2, just it and the dependencies, and the same thing happens. I'll try to reinstall, and a new world. No, not work

GabrielOsvair commented 11 months ago

Works on the Crucible system

xaukael commented 11 months ago

I'd bet dnd5e is setting token dimensions based on the size of the actor. I will ask around to see if there is a way around that.

xaukael commented 11 months ago

I put a temporary fix for dnd5e in 0.5.2

GabrielOsvair commented 11 months ago

I tested it and it still doesn't respect the aspect ratio...

xaukael commented 11 months ago

I tested and it is working on v10 and v11. I pushed another version just in case the other one did not take for some reason. I had some syntax cleanup to do anyhow.

GabrielOsvair commented 10 months ago

Now with D&D in v2.3 it works