Fossil SCM
Reinstate the timeline arrow foreground color changes that were removed by check-in [7ac88481a69dd], but with fixes to avoid integer overflow.
Commit
57a0143b52d5c90f5bba64e10356c4016a35d5d7495de1db260d8e8633a6b4f1
Parent
6499c93dbfbabcd…
1 file changed
+5
-5
+5
-5
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -747,11 +747,10 @@ | ||
| 747 | 747 | @ </table> |
| 748 | 748 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 749 | 749 | timeline_output_graph_javascript(pGraph, tmFlags, iTableId); |
| 750 | 750 | } |
| 751 | 751 | |
| 752 | -#if 0 /* not used */ | |
| 753 | 752 | /* |
| 754 | 753 | ** Change the RGB background color given in the argument in a foreground |
| 755 | 754 | ** color with the same hue. |
| 756 | 755 | */ |
| 757 | 756 | static const char *bg_to_fg(const char *zIn){ |
| @@ -773,16 +772,19 @@ | ||
| 773 | 772 | static const unsigned int t = 215; |
| 774 | 773 | if( mx<t ) for(i=0; i<3; i++) x[i] += t - mx; |
| 775 | 774 | }else{ |
| 776 | 775 | /* Make the color darker */ |
| 777 | 776 | static const unsigned int t = 128; |
| 778 | - if( mx>t ) for(i=0; i<3; i++) x[i] -= mx - t; | |
| 777 | + if( mx>t ){ | |
| 778 | + for(i=0; i<3; i++){ | |
| 779 | + x[i] = x[i]>=mx-t ? x[i] - (mx-t) : 0; | |
| 780 | + } | |
| 781 | + } | |
| 779 | 782 | } |
| 780 | 783 | sqlite3_snprintf(sizeof(zRes),zRes,"#%02x%02x%02x",x[0],x[1],x[2]); |
| 781 | 784 | return zRes; |
| 782 | 785 | } |
| 783 | -#endif /* not used */ | |
| 784 | 786 | |
| 785 | 787 | /* |
| 786 | 788 | ** Generate all of the necessary javascript to generate a timeline |
| 787 | 789 | ** graph. |
| 788 | 790 | */ |
| @@ -880,15 +882,13 @@ | ||
| 880 | 882 | cSep = ','; |
| 881 | 883 | } |
| 882 | 884 | } |
| 883 | 885 | if( cSep=='[' ) cgi_printf("["); |
| 884 | 886 | cgi_printf("],"); |
| 885 | -#if 0 | |
| 886 | 887 | if( colorGraph && pRow->zBgClr[0]=='#' ){ |
| 887 | 888 | cgi_printf("\"fg\":\"%s\",", bg_to_fg(pRow->zBgClr)); |
| 888 | 889 | } |
| 889 | -#endif | |
| 890 | 890 | /* mi */ |
| 891 | 891 | cgi_printf("\"mi\":"); |
| 892 | 892 | cSep = '['; |
| 893 | 893 | for(i=0; i<GR_MAX_RAIL; i++){ |
| 894 | 894 | if( pRow->mergeIn[i] ){ |
| 895 | 895 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -747,11 +747,10 @@ | |
| 747 | @ </table> |
| 748 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 749 | timeline_output_graph_javascript(pGraph, tmFlags, iTableId); |
| 750 | } |
| 751 | |
| 752 | #if 0 /* not used */ |
| 753 | /* |
| 754 | ** Change the RGB background color given in the argument in a foreground |
| 755 | ** color with the same hue. |
| 756 | */ |
| 757 | static const char *bg_to_fg(const char *zIn){ |
| @@ -773,16 +772,19 @@ | |
| 773 | static const unsigned int t = 215; |
| 774 | if( mx<t ) for(i=0; i<3; i++) x[i] += t - mx; |
| 775 | }else{ |
| 776 | /* Make the color darker */ |
| 777 | static const unsigned int t = 128; |
| 778 | if( mx>t ) for(i=0; i<3; i++) x[i] -= mx - t; |
| 779 | } |
| 780 | sqlite3_snprintf(sizeof(zRes),zRes,"#%02x%02x%02x",x[0],x[1],x[2]); |
| 781 | return zRes; |
| 782 | } |
| 783 | #endif /* not used */ |
| 784 | |
| 785 | /* |
| 786 | ** Generate all of the necessary javascript to generate a timeline |
| 787 | ** graph. |
| 788 | */ |
| @@ -880,15 +882,13 @@ | |
| 880 | cSep = ','; |
| 881 | } |
| 882 | } |
| 883 | if( cSep=='[' ) cgi_printf("["); |
| 884 | cgi_printf("],"); |
| 885 | #if 0 |
| 886 | if( colorGraph && pRow->zBgClr[0]=='#' ){ |
| 887 | cgi_printf("\"fg\":\"%s\",", bg_to_fg(pRow->zBgClr)); |
| 888 | } |
| 889 | #endif |
| 890 | /* mi */ |
| 891 | cgi_printf("\"mi\":"); |
| 892 | cSep = '['; |
| 893 | for(i=0; i<GR_MAX_RAIL; i++){ |
| 894 | if( pRow->mergeIn[i] ){ |
| 895 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -747,11 +747,10 @@ | |
| 747 | @ </table> |
| 748 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 749 | timeline_output_graph_javascript(pGraph, tmFlags, iTableId); |
| 750 | } |
| 751 | |
| 752 | /* |
| 753 | ** Change the RGB background color given in the argument in a foreground |
| 754 | ** color with the same hue. |
| 755 | */ |
| 756 | static const char *bg_to_fg(const char *zIn){ |
| @@ -773,16 +772,19 @@ | |
| 772 | static const unsigned int t = 215; |
| 773 | if( mx<t ) for(i=0; i<3; i++) x[i] += t - mx; |
| 774 | }else{ |
| 775 | /* Make the color darker */ |
| 776 | static const unsigned int t = 128; |
| 777 | if( mx>t ){ |
| 778 | for(i=0; i<3; i++){ |
| 779 | x[i] = x[i]>=mx-t ? x[i] - (mx-t) : 0; |
| 780 | } |
| 781 | } |
| 782 | } |
| 783 | sqlite3_snprintf(sizeof(zRes),zRes,"#%02x%02x%02x",x[0],x[1],x[2]); |
| 784 | return zRes; |
| 785 | } |
| 786 | |
| 787 | /* |
| 788 | ** Generate all of the necessary javascript to generate a timeline |
| 789 | ** graph. |
| 790 | */ |
| @@ -880,15 +882,13 @@ | |
| 882 | cSep = ','; |
| 883 | } |
| 884 | } |
| 885 | if( cSep=='[' ) cgi_printf("["); |
| 886 | cgi_printf("],"); |
| 887 | if( colorGraph && pRow->zBgClr[0]=='#' ){ |
| 888 | cgi_printf("\"fg\":\"%s\",", bg_to_fg(pRow->zBgClr)); |
| 889 | } |
| 890 | /* mi */ |
| 891 | cgi_printf("\"mi\":"); |
| 892 | cSep = '['; |
| 893 | for(i=0; i<GR_MAX_RAIL; i++){ |
| 894 | if( pRow->mergeIn[i] ){ |
| 895 |