git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58189
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
int xPos, int yPos,
bool noRefresh)
{
int xPos, int yPos,
bool noRefresh)
{
- int xs, ys;
- GetViewStart(& xs, & ys);
-
- int old_x = m_xScrollPixelsPerLine * xs;
- int old_y = m_yScrollPixelsPerLine * ys;
-
m_xScrollPixelsPerLine = pixelsPerUnitX;
m_yScrollPixelsPerLine = pixelsPerUnitY;
m_xScrollPixelsPerLine = pixelsPerUnitX;
m_yScrollPixelsPerLine = pixelsPerUnitY;
m_targetWindow->SetVirtualSize( w ? w : wxDefaultCoord,
h ? h : wxDefaultCoord);
m_targetWindow->SetVirtualSize( w ? w : wxDefaultCoord,
h ? h : wxDefaultCoord);
+ // Query view start after m_targetWindow->SetVirtualSize(...) since
+ // that call can change the current=old scrolling position!
+ int xs, ys;
+ GetViewStart(& xs, & ys);
+ int old_x = m_xScrollPixelsPerLine * xs;
+ int old_y = m_yScrollPixelsPerLine * ys;
+
// If the target is not the same as the window with the scrollbars,
// then we need to update the scrollbars here, since they won't have
// been updated by SetVirtualSize().
// If the target is not the same as the window with the scrollbars,
// then we need to update the scrollbars here, since they won't have
// been updated by SetVirtualSize().
GtkAdjustment* adj = range->adjustment;
adj->step_increment = 1;
GtkAdjustment* adj = range->adjustment;
adj->step_increment = 1;
adj->page_size = page_size;
gtk_range_set_range(range, 0, upper);
adj->page_size = page_size;
gtk_range_set_range(range, 0, upper);