Skip to content

Conversation

@robalni
Copy link
Contributor

@robalni robalni commented Sep 10, 2020

This change makes the code easier to read. It changes behaviour of drawskin slightly; now it stretches the image instead of repeating it but that should not be visible with default skin.

int w = max(x2-x1, 2), h = max(y2-y1, 2), tw = size ? size : t->w, th = size ? size : t->h;
float pw = tw*0.25f, ph = th*0.25f, qw = tw*0.5f, qh = th*0.5f, px = 0, py = 0, tx = 0, ty = 0;
if(w < qw)
int width = max(x2 - x1, 2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be awesome if you could change max and min to std::max and std::min c:

if(w < qw)
int width = max(x2 - x1, 2);
int height = max(y2 - y1, 2);
int tw = size ? size : t->w;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please write size != 0 ? ... instead of just size ? ...

@MoonPadUSer
Copy link
Contributor

Isn't the drawskin() function supposed to use some kind of 9-split and repeat it based on that? Instead of just plain stretching/repeating

@robalni
Copy link
Contributor Author

robalni commented Sep 11, 2020

Yes, it still splits it in 9. It's just the center piece that is stretched now instead of repeated.

@MoonPadUSer
Copy link
Contributor

I think that's not how you're supposed to do that, ideally it repeats it so it can give ideal results

@robalni
Copy link
Contributor Author

robalni commented Sep 11, 2020

Doesn't that just depend on what skin you have? Some skins look better stretched and some repeated.

@MoonPadUSer
Copy link
Contributor

yeah, but usually you design your skins in a way so they look the best when repeated, e.g. if you have a low-res skin, stretched will make it look very pixelated

@TheAssassin TheAssassin added this to the 1.7.0 milestone Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants