Skip to content

fixing @2x problem #1

@feyyy

Description

@feyyy

Hello shiami,

Thank you for this library. It saved my day.

Your "+ (UIImage_)createResizableImageFromNinePatchImage:(UIImage_)" method has a problem with images ending "@2x".

for @2x images image.size.width and ....height returns values as points not pixels. To fix that you can multiply image.size.width with image.scale.

I fixed the problem by adding
float scl = ninePatchImage.scale;
int w = ninePatchImage.size.width * scl;
int h = ninePatchImage.size.height * scl;
at the beginning of your "+ (UIImage_)createResizableImageFromNinePatchImage:(UIImage_)" method and replaced all remaining
"ninePatchImage.size.width" with w and
"ninePatchImage.size.height" with h.

Rest of the code is awesome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions