evgenyneu / Cosmos

A star rating control for iOS/tvOS written in Swift
MIT License
2.19k stars 368 forks source link

Jagged vector images in custom star image. #116

Closed Madmar1k closed 6 years ago

Madmar1k commented 6 years ago

Hi! I'm setting custom image from PDF files. Settings of files set to Preserve Vector Data and Scales: Single Scale. cosmosView.settings.filledImage = UIImage(named: "rate_icon_A") cosmosView.settings.emptyImage = UIImage(named: "rate_icon_B") cosmosView.settings.starSize = 50 But image looks jagged. Tried to disable improvePerformance() and init with custom frame. When I place that images to UIImageView it's looks fine. How can I solve it?

evgenyneu commented 6 years ago

Thanks for reporting @Madmar1k. Do you mind attaching the image file so I can try it?

Madmar1k commented 6 years ago

rating_stars.zip OK.

evgenyneu commented 6 years ago

Thanks for the image. I could reproduce the issue. A quick fix would be to resize the PDF to 50 pixels, see the attached demo app. I'm not sure why it was blurry with the original smaller images. I found a discussion of the issue that could be similar to yours here. Let me know if it helps.

CosmosWithImage.zip

Madmar1k commented 6 years ago

Thanks, it helps. Manually resized PDF images.