Skip to content

Commit

Permalink
(#1142) snap_var4 -> snap_seg2seg
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Nov 24, 2019
1 parent 0b443f4 commit 05467bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/game/level/level_editor/rect_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ void snap_var2seg(float *x, float y,
}

static
void snap_var4(float *x, float y, float xo, float yo, float st)
void snap_seg2seg(float *x, float y, float xo, float yo, float st)
{
snap_var(x, y, 0, 0, st);
snap_var(x, y, 0, yo, st);
Expand Down Expand Up @@ -786,11 +786,11 @@ void snap_rects(size_t ignore_index, Rect *a,
const Rect b = rects[i];

if (segment_overlap(vec(a->x, a->x + a->w), vec(b.x, b.x + b.w))) {
snap_var4(&a->y, b.y, a->h, b.h, snapping_threshold);
snap_seg2seg(&a->y, b.y, a->h, b.h, snapping_threshold);
}

if (segment_overlap(vec(a->y, a->y + a->h), vec(b.y, b.y + b.h))) {
snap_var4(&a->x, b.x, a->w, b.w, snapping_threshold);
snap_seg2seg(&a->x, b.x, a->w, b.w, snapping_threshold);
}
}
}
Expand Down

0 comments on commit 05467bf

Please sign in to comment.