From 8df0cf00f300e994c28dd23282e4d7a815d46229 Mon Sep 17 00:00:00 2001 From: joncruz Date: Tue, 28 Feb 2006 09:07:11 +0000 Subject: [PATCH] Fixed bug with color drag-n-drop --- ChangeLog | 5 +++++ src/dialogs/swatches.cpp | 18 +++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13dd31e7b..2c35fb7ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-02-28 Jon A. Cruz + * src/dialogs/swatches.cpp: + + Fixed drag-n-drop out of color to match GTK+ standard. + 2006-02-27 Jon A. Cruz * src/dialogs/swatches.cpp, src/ui/previewfillable.h, src/ui/previewholder.h, src/ui/previewholder.cpp: diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp index 7da1b5694..3063e2280 100644 --- a/src/dialogs/swatches.cpp +++ b/src/dialogs/swatches.cpp @@ -101,19 +101,15 @@ static void dragGetColorData( GtkWidget *widget, g_free(tmp); tmp = 0; } else { - guchar tmp[8]; - tmp[0] = item->_r; - tmp[1] = item->_r; - tmp[2] = item->_g; - tmp[3] = item->_g; - tmp[4] = item->_b; - tmp[5] = item->_b; - tmp[6] = 0x0ff; - tmp[7] = 0x0ff; + guint16 tmp[4]; + tmp[0] = (item->_r << 8) | item->_r; + tmp[1] = (item->_g << 8) | item->_g; + tmp[2] = (item->_b << 8) | item->_b; + tmp[3] = 0xffff; gtk_selection_data_set( data, typeXColor, - 8, // format - tmp, + 16, // format + reinterpret_cast(tmp), (3+1) * 2); } } -- 2.30.2