CrazyTim / spin-wheel

An easy to use, themeable component for randomising choices and prizes.
https://crazytim.github.io/spin-wheel/examples/themes
MIT License
206 stars 55 forks source link

Add Support for Custom Width and Height for Image Props #53

Open datisekai opened 4 days ago

datisekai commented 4 days ago

Description: Currently, when trying to set the width and height of an image via props, it appears that the image dimensions are automatically adjusted to fit the wheel.radius. While this keeps the image proportional to the wheel size, it limits control over customizing image dimensions independently.

Setting a smaller wheel.radius reduces the size of the entire wheel, which is not ideal when we only want to adjust the image size without affecting the wheel’s dimensions.

Expected Behavior:

Ability to set width and height of the image independently of wheel.radius. The image should be able to scale to a custom size while the wheel remains unaffected by the image dimensions. Proposed Solution:

Add imageWidth and imageHeight props (or similar) to control the dimensions of the image without relying on wheel.radius. Ensure that setting these props overrides the default behavior where image size is dependent on wheel.radius. Additional Context: I’ve checked the documentation, and it seems the current behavior is to automatically fit the image based on wheel.radius. However, for more flexible UI designs, it would be helpful to have separate control over the image’s width and height.

Thank you for considering this improvement!