(#1142) explain snap_var1 a little bit better

master
rexim 2019-11-24 23:52:20 +07:00
parent 1840b5374b
commit 8467638fbc
1 changed files with 5 additions and 3 deletions

View File

@ -544,9 +544,11 @@ int segment_overlap(Vec2f a, Vec2f b)
}
static
void snap_var1(float *x, float y,
float xo, float yo,
float st)
void snap_var1(float *x, // the value we are snapping
float y, // the target we are snapping x to
float xo, // x offset
float yo, // y offset
float st) // snap threshold
{
if (fabsf((*x + xo) - (y + yo)) < st)
*x = y + yo - xo;