From c34440ffeef2cbd5ef0cbdf07555a85adf778a83 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Tue, 14 Apr 2020 20:45:05 +0200 Subject: [PATCH] Fix positioning wxPropertyGrid editor button Button should be shifted by width, not by height value. --- src/propgrid/editors.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index fa88b88732..078b5f4f95 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1995,8 +1995,11 @@ wxWindow* wxPropertyGrid::GenerateEditorButton( const wxPoint& pos, const wxSize // If button is narrow make it a square and move it to the correct position s = but->GetSize(); if ( s.x < s.y ) - but->SetSize(wxSize(s.y, s.y)); - p.x = pos.x + sz.x - s.y; + { + s.x = s.y; + but->SetSize(s); + } + p.x = pos.x + sz.x - s.x; but->Move(p); if ( selected->HasFlag(wxPG_PROP_READONLY) && !selected->HasFlag(wxPG_PROP_ACTIVE_BTN) )