From 0add64d4ab2609d8b0c0cab4b3500e3edf02bbe2 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 21 Sep 2016 23:08:30 -0500 Subject: [PATCH] push2: fix color map store/lookup for rgba<=>color index mapping --- libs/surfaces/push2/push2.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index a61ec12d71..74e94511c9 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -1513,16 +1513,16 @@ Push2::button_by_id (ButtonID bid) } uint8_t -Push2::get_color_index (uint32_t rgb) +Push2::get_color_index (ArdourCanvas::Color rgba) { - ColorMap::iterator i = color_map.find (rgb); + ColorMap::iterator i = color_map.find (rgba); if (i != color_map.end()) { return i->second; } int r, g, b, a; - UINT_TO_RGBA (rgb, &r, &g, &b, &a); + UINT_TO_RGBA (rgba, &r, &g, &b, &a); int w = 204; /* not sure where/when we should get this value */ /* get a free index */ @@ -1555,7 +1555,7 @@ Push2::get_color_index (uint32_t rgb) write (palette_msg); write (update_pallette_msg); - color_map[index] = rgb; + color_map[rgba] = index; return index; }