private void BoardControl_MouseDown(object sender, MouseEventArgs e) { _mousePressed = true; if (_mouseOverDrawable == null) { return; } _mouseOverDrawable.SetMousePressed(true, e.X, e.Y); _mousePressedDrawable = _mouseOverDrawable; _mouseOverWhilePressedDrawable = _mouseOverDrawable; Refresh(); }
private void BoardControl_MouseUp(object sender, MouseEventArgs e) { _mousePressed = false; if (_mousePressedDrawable == null) { return; } _mousePressedDrawable.SetMousePressed(false, e.X, e.Y); Refresh(); if (_mousePressedDrawable == _mouseOverWhilePressedDrawable) { _mousePressedDrawable.MouseClick(e.X, e.Y); } _mousePressedDrawable = null; }