From 6f3003c3e1ed573ea6713090150e642ab12af85e Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 5 Jul 2015 21:17:35 +0200 Subject: [PATCH] Fix drawing choice item bitmap when using wxPGEditor_Choice. Horizontal alignment of bitmap associated with wxPGChoice item drawn in wxPGComboBox (in wxPropertyGrid::OnComboItemPaint) needs to be adjusted by 1 pixel (as it is already done for text label) in order to get the bitmap in the same position when wxPGComboBox is selected. --- src/propgrid/editors.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 6aec8a0555..6dac6d5290 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -903,9 +903,15 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, if ( choices.IsOk() && item >= 0 && comValIndex < 0 ) { + // This aligns bitmap horizontally so that it is + // on the same position as bitmap drawn for static content + // (without editor). + wxRect r(rect); + r.x -= 1; + cell = &choices.Item(item); renderer = wxPGGlobalVars->m_defaultRenderer; - int imageOffset = renderer->PreDrawCell(dc, rect, *cell, + int imageOffset = renderer->PreDrawCell(dc, r, *cell, renderFlags ); if ( imageOffset ) imageOffset += wxCC_CUSTOM_IMAGE_MARGIN1 +