13 lines
No EOL
488 B
Text
13 lines
No EOL
488 B
Text
/*
|
|
contributors: Patricio Gonzalez Vivo
|
|
description: unFix the aspect ratio
|
|
use: ratio(float2 st, float2 st_size)
|
|
license:
|
|
- Copyright (c) 2021 Patricio Gonzalez Vivo under Prosperity License - https://prosperitylicense.com/versions/3.0.0
|
|
- Copyright (c) 2021 Patricio Gonzalez Vivo under Patron License - https://lygia.xyz/license
|
|
*/
|
|
|
|
#ifndef FNC_UNRATIO
|
|
#define FNC_UNRATIO
|
|
float2 unratio (float2 st, float2 s) { return float2(st.x, st.y*(s.x/s.y)+(s.y*.5-s.x*.5)/s.y); }
|
|
#endif |