fl_arc and fl_rect

I have a draggable canvas and the code below is executed on every drag.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
            if(index == 10){
                for(i = 1; i <= inote; i++){
                    xnote[j] = points[i].x;
                    ynote[j] = points[i].y;
                    if(ynote[j] < 4 || ynote[j] > 80) {
                        fl_arc(xnote[j], ynote[j], w, h, a1, a2);
                    }
                    else {
                        if((durationchoice == 1 || oldchoice == 2) && j == 2){
                            fl_arc(xnote[j], (ynote[j])/5 * 5+13, w, h, a1, a2);
                            oldchoice = 1;
                        }
                    }
                }
                for(i = j; i <= inote; i++){
                    xnote[k] = points[i].x;
                    ynote[k] = points[i].y;
                    if(ynote[k] < 4 || ynote[k] > 80) {
                        fl_arc(xnote[k], ynote[k], w, h, a1, a2);
                    }
                    else {
                        if((durationchoice == 2 || oldchoice != 1) && k == 2){
                            fl_rect(xnote[k], (ynote[k])/5 * 5+13, w, h);
                            oldchoice = 2;
                        }
                    }
                }
                dragsbool = true;
                j = 0;
                k = 0;


When durationchoice == 1, it will draw a fl_arc. Then changing to durationchoice == 2 will draw an fl_rect. But when changing back to durationchoice == 1 will make the fl_rect a fl_arc. How can I implement the if-clauses so that the drawn figures are staying the way they should be? Maybe an integer array oldchoice?
Do you mean that you want to leave a still fl_rect on the screen while a fl_arc is dragged around? And vice-versa?
Indeed.
Why not just have 2 separate coordinate pairs then?
Topic archived. No new replies allowed.