|
|
|
@ -225,8 +225,7 @@ public partial class MainForm : Form |
|
|
|
|
double prevRelScrollPosY = (double)prevScrollPosY / (double)prevMaxScrollY ; |
|
|
|
|
|
|
|
|
|
// resize and position the ChartImage |
|
|
|
|
mChartImagePanel.HorizontalScroll.Value = 0 ; |
|
|
|
|
mChartImagePanel.VerticalScroll.Value = 0 ; |
|
|
|
|
setChartImagePanelScrollPos( 0, 0 ) ; |
|
|
|
|
Size prevChartImagePictureBoxSize = new Size( mChartImagePictureBox.Size.Width, mChartImagePictureBox.Size.Height ) ; |
|
|
|
|
mChartImagePictureBox.Size = new Size( width, height ) ; |
|
|
|
|
if ( width < availableWidth ) |
|
|
|
@ -320,18 +319,14 @@ public partial class MainForm : Form |
|
|
|
|
{ |
|
|
|
|
// update the scroll position |
|
|
|
|
if ( scrollX != null ) { |
|
|
|
|
HScrollProperties hscroll = mChartImagePanel.HorizontalScroll ; |
|
|
|
|
int maxScrollX = ChartImagePanel_MaxScrollX() ; |
|
|
|
|
int scrollPos = Math.Max( 0, Math.Min( maxScrollX, scrollX.Value ) ) ; |
|
|
|
|
hscroll.Value = scrollPos ; |
|
|
|
|
hscroll.Value = scrollPos ; // nb: for Windows :shrug: |
|
|
|
|
setChartImagePanelScrollPos( scrollPos, null ) ; |
|
|
|
|
} |
|
|
|
|
if ( scrollY != null ) { |
|
|
|
|
VScrollProperties vscroll = mChartImagePanel.VerticalScroll ; |
|
|
|
|
int maxScrollY = ChartImagePanel_MaxScrollY() ; |
|
|
|
|
int scrollPos = Math.Max( 0, Math.Min( maxScrollY, scrollY.Value ) ) ; |
|
|
|
|
vscroll.Value = scrollPos ; |
|
|
|
|
vscroll.Value = scrollPos ; // nb: for Windows :shrug: |
|
|
|
|
setChartImagePanelScrollPos( null, scrollPos ) ; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -351,8 +346,7 @@ public partial class MainForm : Form |
|
|
|
|
mChartImagePictureBox.Image = chartImage.image ; |
|
|
|
|
} else |
|
|
|
|
mChartImagePictureBox.Image = null ; |
|
|
|
|
mChartImagePanel.HorizontalScroll.Value = 0 ; |
|
|
|
|
mChartImagePanel.VerticalScroll.Value = 0 ; |
|
|
|
|
setChartImagePanelScrollPos( 0, 0 ) ; |
|
|
|
|
mUserZoom = 1.0 ; |
|
|
|
|
doMainFormResize( null ) ; |
|
|
|
|
} |
|
|
|
|