@@ -55,7 +55,7 @@ void Editor::ResetAll()
5555// led buttons
5656void Editor::DrawButtons (const int & x_items, const int & y_items)
5757{
58- snprintf (hoverdatatext,50 ," " );
58+ snprintf (hoverdatatext,60 ," " );
5959 Vector2 pos = GetMousePosition ();
6060 int starting_x = GetScreenWidth () / 4 + camera_x;
6161 int starting_y = 0 + camera_y; // or GetScreenHeight() / 4 if you want menu at the top
@@ -107,20 +107,27 @@ void Editor::DrawButtons(const int& x_items, const int& y_items)
107107 SetMouseCursor (MOUSE_CURSOR_CROSSHAIR);
108108 cursorishovering = true ;
109109
110- snprintf (hoverdatatext,50 ," hovering over:\n x: %d\n y: %d\n %s" ,j,i,data[curframe][i*w+j].to_string (rgb_or_bw).c_str ());// j - x i - y
111-
112- if (IsMouseButtonPressed (MOUSE_BUTTON_LEFT)) // if led color is the same as preview color clear the led
113- {
114- if (data[curframe][i*w+j] == col)
110+ snprintf (hoverdatatext,60 ," hovering over:\n x: %d\n y: %d\n %s" ,j,i,data[curframe][i*w+j].to_string (rgb_or_bw).c_str ());// j - x i - y
111+ if (singledrawmode)
112+ { // click to draw
113+ if (IsMouseButtonPressed (MOUSE_BUTTON_LEFT)) // if led color is the same as preview color clear the led
115114 {
116- leddata blank;
117- blank.r = 0 ;
118- blank.g = 0 ;
119- blank.b = 0 ;
120- blank.a = 255 ;
121- data[curframe][i*w+j] = blank;
115+ if (data[curframe][i*w+j] == col)
116+ {
117+ leddata blank;
118+ blank.r = 0 ;
119+ blank.g = 0 ;
120+ blank.b = 0 ;
121+ blank.a = 255 ;
122+ data[curframe][i*w+j] = blank;
123+ }
124+ else data[curframe][i*w+j]=col;
122125 }
123- else data[curframe][i*w+j]=col;
126+ }
127+ else
128+ { // hold to draw
129+ if (IsMouseButtonDown (MOUSE_BUTTON_LEFT))
130+ data[curframe][i*w+j]=col;
124131 }
125132 }
126133
0 commit comments