summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2022-08-07 13:15:34 +0200
committerLuke from DC <[email protected]>2022-08-19 00:46:15 +0000
commit6c7a59d5c0049a1656755a3ec102fb7a3a513cc3 (patch)
tree1b186ab10ee721dadfb6930796995b729c36e31c
parentaf9f244bb0706fe41bd41d6a04f6606dcb62746a (diff)
downloadmate-system-monitor-6c7a59d5c0049a1656755a3ec102fb7a3a513cc3.tar.bz2
mate-system-monitor-6c7a59d5c0049a1656755a3ec102fb7a3a513cc3.tar.xz
gsm_color_button: Fix -Wfloat-conversion warning
-rw-r--r--src/gsm_color_button.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gsm_color_button.c b/src/gsm_color_button.c
index 27aee1c..d706ba7 100644
--- a/src/gsm_color_button.c
+++ b/src/gsm_color_button.c
@@ -505,9 +505,9 @@ gsm_color_button_drag_data_received (GtkWidget * widget,
dropped = (guint16 *) gtk_selection_data_get_data (selection_data);
- priv->color.red = dropped[0];
- priv->color.green = dropped[1];
- priv->color.blue = dropped[2];
+ priv->color.red = ((double) dropped[0]) / 65535.0;
+ priv->color.green = ((double) dropped[1]) / 65535.0;
+ priv->color.blue = ((double) dropped[2]) / 65535.0;
gtk_widget_queue_draw (GTK_WIDGET(color_button));
@@ -560,9 +560,9 @@ gsm_color_button_drag_data_get (GtkWidget * widget,
priv = gsm_color_button_get_instance_private (color_button);
- dropped[0] = priv->color.red;
- dropped[1] = priv->color.green;
- dropped[2] = priv->color.blue;
+ dropped[0] = (guint16) (65535.0 * priv->color.red);
+ dropped[1] = (guint16) (65535.0 * priv->color.green);
+ dropped[2] = (guint16) (65535.0 * priv->color.blue);
dropped[3] = 65535; // This widget doesn't care about alpha
gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data),