scroll is now right-mouse + drag; feedback while dragging added.
added another 5 tiles to right-hand-side, so i dont get black on hi-res display :) git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1100 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -66,6 +66,35 @@ namespace ShpViewer
|
||||
mapViewControl1.TileSet = tileSet;
|
||||
mapViewControl1.Invalidate();
|
||||
|
||||
int ux = 0, uy = 0;
|
||||
int vx = 0, vy = 0;
|
||||
|
||||
mapViewControl1.MouseDown += delegate(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
ux = e.X;
|
||||
uy = e.Y;
|
||||
|
||||
vx = mapViewControl1.XScroll;
|
||||
vy = mapViewControl1.YScroll;
|
||||
}
|
||||
};
|
||||
|
||||
mapViewControl1.MouseMove += delegate(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
int dx = e.X - ux;
|
||||
int dy = e.Y - uy;
|
||||
|
||||
mapViewControl1.XScroll = vx + dx / 24;
|
||||
mapViewControl1.YScroll = vy + dy / 24;
|
||||
|
||||
mapViewControl1.Invalidate();
|
||||
}
|
||||
};
|
||||
|
||||
mapViewControl1.MouseClick += delegate( object sender, MouseEventArgs e )
|
||||
{
|
||||
if( e.Button == MouseButtons.Left )
|
||||
@@ -73,14 +102,6 @@ namespace ShpViewer
|
||||
mapViewControl1.Map = new Map( iniFile );
|
||||
mapViewControl1.TileSet = LoadTileSet( map );
|
||||
}
|
||||
else if( e.Button == MouseButtons.Middle )
|
||||
{
|
||||
int dx = ( e.X * 2 - mapViewControl1.Width ) / 24;
|
||||
int dy = ( e.Y * 2 - mapViewControl1.Height ) / 24;
|
||||
|
||||
mapViewControl1.XScroll += dx;
|
||||
mapViewControl1.YScroll += dy;
|
||||
}
|
||||
mapViewControl1.Invalidate();
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user