From d96305c012a45c642672ce6f1954509e31d985c8 Mon Sep 17 00:00:00 2001 From: davidovski Date: Sun, 5 Dec 2021 21:33:13 +0000 Subject: [PATCH] fixed visual bugs --- rope.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rope.c b/rope.c index b4561bc..27f728f 100755 --- a/rope.c +++ b/rope.c @@ -66,10 +66,6 @@ int draw(void) { int count = sizeof(points) / sizeof(Point); - if (holding > -1) { - Point *p = &points[holding]; - p->pos = mouse; - } for (int i = 0; i < count; i++) { Point *p = &points[i]; @@ -92,9 +88,16 @@ int draw(void) { } else { holding = -1; } + } + if (holding > -1) { + Point *p = &points[holding]; + p->pos = mouse; + } + for (int i = 0; i < count; i++) { + Point *p = &points[i]; + Point *n = &points[(i+1)% count]; DrawCircle(p->pos.x, p->pos.y, radius, DARKGRAY); - DrawLineEx(p->pos, n->pos, radius / 2, DARKGRAY); }