Browse Source

Added missing check for GDISP_NEED_CIRCLE

Steffen Schroeter 3 years ago
parent
commit
c119ca4a5d
2 changed files with 14 additions and 10 deletions
  1. 3 1
      src/gwin/gwin_class.h
  2. 11 9
      src/gwin/gwin_widget.c

+ 3 - 1
src/gwin/gwin_class.h

@@ -371,7 +371,9 @@ bool_t _gwinWMAdd(GHandle gh, const GWindowInit *pInit);
371 371
 		 *
372 372
 		 * @notapi
373 373
 		 */
374
-		void _gwidgetDrawFocusCircle(GWidgetObject *gx, coord_t radius);
374
+		#if GDISP_NEED_CIRCLE
375
+			void _gwidgetDrawFocusCircle(GWidgetObject *gx, coord_t radius);
376
+		#endif
375 377
 
376 378
 	#else
377 379
 		#define _gwinFixFocus(gh)

+ 11 - 9
src/gwin/gwin_widget.c

@@ -330,17 +330,19 @@ static void gwidgetEvent(void *param, GEvent *pe) {
330 330
 		}
331 331
 	}
332 332
 
333
-	void _gwidgetDrawFocusCircle(GWidgetObject *gx, coord_t radius) {
334
-		coord_t i;
333
+	#if GDISP_NEED_CIRCLE
334
+		void _gwidgetDrawFocusCircle(GWidgetObject *gx, coord_t radius) {
335
+			coord_t i;
335 336
 
336
-		// Don't do anything if we don't have the focus
337
-		if (&gx->g != _widgetInFocus)
338
-			return;
339
-    
340
-		for (i = 0; i < GWIN_FOCUS_HIGHLIGHT_WIDTH; i++) {
341
-			gdispGDrawCircle(gx->g.display, gx->g.x + radius, gx->g.y + radius, radius + i, gx->pstyle->focus);
337
+			// Don't do anything if we don't have the focus
338
+			if (&gx->g != _widgetInFocus)
339
+				return;
340
+
341
+			for (i = 0; i < GWIN_FOCUS_HIGHLIGHT_WIDTH; i++) {
342
+				gdispGDrawCircle(gx->g.display, gx->g.x + radius, gx->g.y + radius, radius + i, gx->pstyle->focus);
343
+			}
342 344
 		}
343
-	}
345
+	#endif
344 346
 #endif
345 347
 
346 348
 #if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE