diff options
Diffstat (limited to 'iup/srccontrols/color')
-rwxr-xr-x | iup/srccontrols/color/iup_colorbrowser.c | 8 | ||||
-rwxr-xr-x | iup/srccontrols/color/iup_colorbrowserdlg.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/iup/srccontrols/color/iup_colorbrowser.c b/iup/srccontrols/color/iup_colorbrowser.c index 82b4a88..51f8a30 100755 --- a/iup/srccontrols/color/iup_colorbrowser.c +++ b/iup/srccontrols/color/iup_colorbrowser.c @@ -681,7 +681,7 @@ static int iColorBrowserKeypress_CB(Ihandle* ih, int c, int press) static char* iColorBrowserGetHSIAttrib(Ihandle* ih) { char* buffer = iupStrGetMemory(100); - sprintf(buffer, "%f %f %f", (double)ih->data->hue, (double)ih->data->saturation, (double)ih->data->intensity); + sprintf(buffer, "%g %g %g", (double)ih->data->hue, (double)ih->data->saturation, (double)ih->data->intensity); return buffer; } @@ -781,10 +781,16 @@ static int iColorBrowserMapMethod(Ihandle* ih) static void iColorBrowserUnMapMethod(Ihandle* ih) { if (ih->data->cddbuffer) + { cdKillCanvas(ih->data->cddbuffer); + ih->data->cddbuffer = NULL; + } if (ih->data->cdcanvas) + { cdKillCanvas(ih->data->cdcanvas); + ih->data->cdcanvas = NULL; + } } static int iColorBrowserCreateMethod(Ihandle* ih, void **params) diff --git a/iup/srccontrols/color/iup_colorbrowserdlg.c b/iup/srccontrols/color/iup_colorbrowserdlg.c index 65e4d37..dc52725 100755 --- a/iup/srccontrols/color/iup_colorbrowserdlg.c +++ b/iup/srccontrols/color/iup_colorbrowserdlg.c @@ -158,7 +158,7 @@ static void iColorBrowserDlgBrowserRGB_Update(IcolorDlgData* colordlg_data) static void iColorBrowserDlgBrowserHSI_Update(IcolorDlgData* colordlg_data) { - IupSetfAttribute(colordlg_data->color_browser, "HSI", "%f %f %f", (double)colordlg_data->hue, (double)colordlg_data->saturation, (double)colordlg_data->intensity); + IupSetfAttribute(colordlg_data->color_browser, "HSI", "%g %g %g", (double)colordlg_data->hue, (double)colordlg_data->saturation, (double)colordlg_data->intensity); } /*****************************************\ @@ -575,10 +575,16 @@ static int iColorBrowserDlgColorCnvUnMap_CB(Ihandle* ih) IcolorDlgData* colordlg_data = (IcolorDlgData*)iupAttribGetInherit(ih, "_IUP_GC_DATA"); if (colordlg_data->color_cddbuffer) + { cdKillCanvas(colordlg_data->color_cddbuffer); + colordlg_data->color_cddbuffer = NULL; + } if (colordlg_data->color_cdcanvas) + { cdKillCanvas(colordlg_data->color_cdcanvas); + colordlg_data->color_cdcanvas = NULL; + } return IUP_DEFAULT; } |