mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-10-06 07:00:16 +08:00
Fix updating saved splitter position on DPI change
While the current and minimum positions were updated, the saved last split position was not, so unsplitting the splitter, changing the DPI and splitting it again wouldn't use the correct position for the new DPI. Also rescale m_requestedSashPosition if it's valid even if it's not clear whether this can happen or not.
This commit is contained in:
@@ -512,6 +512,13 @@ void wxSplitterWindow::OnDPIChanged(wxDPIChangedEvent& event)
|
||||
m_minimumPaneSize = event.ScaleX(m_minimumPaneSize);
|
||||
m_sashPosition = event.ScaleX(m_sashPosition);
|
||||
m_lastSize = event.Scale(m_lastSize);
|
||||
|
||||
// Any saved or pending positions need to be updated too.
|
||||
m_lastSplitPosition = event.Scale(m_lastSplitPosition);
|
||||
|
||||
// But this one should only be scaled if it is really valid.
|
||||
if ( m_requestedSashPosition != INT_MAX )
|
||||
m_requestedSashPosition = event.ScaleX(m_requestedSashPosition);
|
||||
#endif // !wxHAS_DPI_INDEPENDENT_PIXELS
|
||||
|
||||
event.Skip();
|
||||
|
||||
Reference in New Issue
Block a user