@@ -695,7 +695,7 @@ overview(struct nk_context *ctx)
695695 ctx -> style .chart .show_markers = show_markers ;
696696 if (nk_chart_begin (ctx , NK_CHART_LINES , 32 , -1.0f , 1.0f )) {
697697 for (i = 0 ; i < 32 ; ++ i ) {
698- nk_flags res = nk_chart_push (ctx , (float )cos (id ));
698+ nk_flags res = nk_chart_push (ctx , (float )NK_COS (id ));
699699 if (res & NK_CHART_HOVERING )
700700 index = (int )i ;
701701 if (res & NK_CHART_CLICKED )
@@ -706,17 +706,17 @@ overview(struct nk_context *ctx)
706706 }
707707
708708 if (index != -1 )
709- nk_tooltipf (ctx , "Value: %.2f" , (float )cos ((float )index * step ));
709+ nk_tooltipf (ctx , "Value: %.2f" , (float )NK_COS ((float )index * step ));
710710 if (line_index != -1 ) {
711711 nk_layout_row_dynamic (ctx , 20 , 1 );
712- nk_labelf (ctx , NK_TEXT_LEFT , "Selected value: %.2f" , (float )cos ((float )index * step ));
712+ nk_labelf (ctx , NK_TEXT_LEFT , "Selected value: %.2f" , (float )NK_COS ((float )index * step ));
713713 }
714714
715715 /* column chart */
716716 nk_layout_row_dynamic (ctx , 100 , 1 );
717717 if (nk_chart_begin (ctx , NK_CHART_COLUMN , 32 , 0.0f , 1.0f )) {
718718 for (i = 0 ; i < 32 ; ++ i ) {
719- nk_flags res = nk_chart_push (ctx , (float )fabs ( sin (id )));
719+ nk_flags res = nk_chart_push (ctx , (float )NK_ABS ( NK_SIN (id )));
720720 if (res & NK_CHART_HOVERING )
721721 index = (int )i ;
722722 if (res & NK_CHART_CLICKED )
@@ -726,10 +726,10 @@ overview(struct nk_context *ctx)
726726 nk_chart_end (ctx );
727727 }
728728 if (index != -1 )
729- nk_tooltipf (ctx , "Value: %.2f" , (float )fabs ( sin (step * (float )index )));
729+ nk_tooltipf (ctx , "Value: %.2f" , (float )NK_ABS ( NK_SIN (step * (float )index )));
730730 if (col_index != -1 ) {
731731 nk_layout_row_dynamic (ctx , 20 , 1 );
732- nk_labelf (ctx , NK_TEXT_LEFT , "Selected value: %.2f" , (float )fabs ( sin (step * (float )col_index )));
732+ nk_labelf (ctx , NK_TEXT_LEFT , "Selected value: %.2f" , (float )NK_ABS ( NK_SIN (step * (float )col_index )));
733733 }
734734
735735 /* mixed chart */
@@ -738,9 +738,9 @@ overview(struct nk_context *ctx)
738738 nk_chart_add_slot (ctx , NK_CHART_LINES , 32 , -1.0f , 1.0f );
739739 nk_chart_add_slot (ctx , NK_CHART_LINES , 32 , -1.0f , 1.0f );
740740 for (id = 0 , i = 0 ; i < 32 ; ++ i ) {
741- nk_chart_push_slot (ctx , (float )fabs ( sin (id )), 0 );
742- nk_chart_push_slot (ctx , (float )cos (id ), 1 );
743- nk_chart_push_slot (ctx , (float )sin (id ), 2 );
741+ nk_chart_push_slot (ctx , (float )NK_ABS ( NK_SIN (id )), 0 );
742+ nk_chart_push_slot (ctx , (float )NK_COS (id ), 1 );
743+ nk_chart_push_slot (ctx , (float )NK_SIN (id ), 2 );
744744 id += step ;
745745 }
746746 }
@@ -752,9 +752,9 @@ overview(struct nk_context *ctx)
752752 nk_chart_add_slot_colored (ctx , NK_CHART_LINES , nk_rgb (0 ,0 ,255 ), nk_rgb (0 ,0 ,150 ),32 , -1.0f , 1.0f );
753753 nk_chart_add_slot_colored (ctx , NK_CHART_LINES , nk_rgb (0 ,255 ,0 ), nk_rgb (0 ,150 ,0 ), 32 , -1.0f , 1.0f );
754754 for (id = 0 , i = 0 ; i < 32 ; ++ i ) {
755- nk_chart_push_slot (ctx , (float )fabs ( sin (id )), 0 );
756- nk_chart_push_slot (ctx , (float )cos (id ), 1 );
757- nk_chart_push_slot (ctx , (float )sin (id ), 2 );
755+ nk_chart_push_slot (ctx , (float )NK_ABS ( NK_SIN (id )), 0 );
756+ nk_chart_push_slot (ctx , (float )NK_COS (id ), 1 );
757+ nk_chart_push_slot (ctx , (float )NK_SIN (id ), 2 );
758758 id += step ;
759759 }
760760 }
@@ -1120,8 +1120,8 @@ overview(struct nk_context *ctx)
11201120 if (nk_chart_begin_colored (ctx , NK_CHART_LINES , nk_rgb (255 ,0 ,0 ), nk_rgb (150 ,0 ,0 ), 32 , 0.0f , 1.0f )) {
11211121 nk_chart_add_slot_colored (ctx , NK_CHART_LINES , nk_rgb (0 ,0 ,255 ), nk_rgb (0 ,0 ,150 ),32 , -1.0f , 1.0f );
11221122 for (i = 0 , id = 0 ; i < 32 ; ++ i ) {
1123- nk_chart_push_slot (ctx , (float )fabs ( sin (id )), 0 );
1124- nk_chart_push_slot (ctx , (float )cos (id ), 1 );
1123+ nk_chart_push_slot (ctx , (float )NK_ABS ( NK_SIN (id )), 0 );
1124+ nk_chart_push_slot (ctx , (float )NK_COS (id ), 1 );
11251125 id += step ;
11261126 }
11271127 }
@@ -1131,7 +1131,7 @@ overview(struct nk_context *ctx)
11311131 nk_layout_row_dynamic (ctx , 100 , 1 );
11321132 if (nk_chart_begin_colored (ctx , NK_CHART_COLUMN , nk_rgb (255 ,0 ,0 ), nk_rgb (150 ,0 ,0 ), 32 , 0.0f , 1.0f )) {
11331133 for (i = 0 , id = 0 ; i < 32 ; ++ i ) {
1134- nk_chart_push_slot (ctx , (float )fabs ( sin (id )), 0 );
1134+ nk_chart_push_slot (ctx , (float )NK_ABS ( NK_SIN (id )), 0 );
11351135 id += step ;
11361136 }
11371137 }
@@ -1143,9 +1143,9 @@ overview(struct nk_context *ctx)
11431143 nk_chart_add_slot_colored (ctx , NK_CHART_LINES , nk_rgb (0 ,0 ,255 ), nk_rgb (0 ,0 ,150 ),32 , -1.0f , 1.0f );
11441144 nk_chart_add_slot_colored (ctx , NK_CHART_COLUMN , nk_rgb (0 ,255 ,0 ), nk_rgb (0 ,150 ,0 ), 32 , 0.0f , 1.0f );
11451145 for (i = 0 , id = 0 ; i < 32 ; ++ i ) {
1146- nk_chart_push_slot (ctx , (float )fabs ( sin (id )), 0 );
1147- nk_chart_push_slot (ctx , (float )fabs ( cos (id )), 1 );
1148- nk_chart_push_slot (ctx , (float )fabs ( sin (id )), 2 );
1146+ nk_chart_push_slot (ctx , (float )NK_ABS ( NK_SIN (id )), 0 );
1147+ nk_chart_push_slot (ctx , (float )NK_ABS ( NK_COS (id )), 1 );
1148+ nk_chart_push_slot (ctx , (float )NK_ABS ( NK_SIN (id )), 2 );
11491149 id += step ;
11501150 }
11511151 }
0 commit comments