From 41d534ac0d89c2a1081bb897b0bf6cf8ea38f925 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 22 Aug 2018 08:39:13 -0700 Subject: [PATCH] Use more accurate color conversion in DoGetPixel() --- src/gtk/dcclient.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 9e98f62b4d..52349d0e0a 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -487,7 +487,7 @@ bool wxWindowDCImpl::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const } if (image == NULL) { - *col = wxColour(); + col->UnRef(); return false; } GdkColormap* colormap = gdk_image_get_colormap(image); @@ -498,7 +498,7 @@ bool wxWindowDCImpl::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const { GdkColor c; gdk_colormap_query_color(colormap, pixel, &c); - col->Set(c.red >> 8, c.green >> 8, c.blue >> 8); + *col = wxColour(c); } g_object_unref(image); return true; @@ -2062,7 +2062,7 @@ void wxWindowDCImpl::ComputeScaleAndOrigin() // this is a bit artificial, but we need to force wxDC to think the pen // has changed wxPen pen = m_pen; - m_pen = wxNullPen; + m_pen.UnRef(); SetPen( pen ); }