private void pictureBox_MouseDown(object sender, MouseEventArgs e) { if (tileset == null) { return; } Point at = ResolveTilePoint(e.Location); if (tileset.ContainsTile(at)) { selecting = true; selectingStart = at; selection = new Rectangle(at.X, at.Y, 1, 1); pictureBox.Refresh(); } }
private void pictureBox_MouseDown(object sender, MouseEventArgs e) { if (tileset == null) { return; } if (e.Button == MouseButtons.Right || e.Button == MouseButtons.Middle) { panning = true; prevPanLocation = e.Location; } else { Point at = ResolveTilePoint(e.Location); if (tileset.ContainsTile(at)) { selecting = true; selectingStart = at; selection = new Rectangle(at.X, at.Y, 1, 1); pictureBox.Refresh(); } } }