これは、これがうまくいかない理由の多くです。幅と高さの値を計算すると、最初に使用したのと同じ静的な値が得られる理由を一生理解できないため、明らかに何かが欠けているに違いありません。しかし、ハードコードされた値に置き換えると、問題なく機能します。だから明らかに私の計算は悪いですが、私は理由を理解できないようです。誰か助けてもらえますか?さらに詳しい情報が必要な場合はお問い合わせください。
if(objectList[selectedIndex].Selected == true)
{
//The width would be mouselocationx - objectlocationx
//The height would be mouselocationy - objectlocationy
//Off set the position so it doesnt snap to mouse location
//WHY THE *%$!! DOESNT THIS WORK!!?!?!?!?!?!?
//int width = e.X - objectList[selectedIndex].X;
//int height = e.Y - objectList[selectedIndex].Y;
//Why is this so hard??
//Point location = objectList[selectedIndex].Location;
//location.X = e.X - (e.X - objectList[selectedIndex].Location.X);
//location.Y = e.Y - (e.Y - objectList[selectedIndex].Location.Y);
objectList[selectedIndex].X = e.Location.X - 12;
objectList[selectedIndex].Y = e.Location.Y - 12;
objectLocationXLabel.Text = "OBJX: " + objectList[selectedIndex].X.ToString();
objectLocationYLabel.Text = "OBJY: " + objectList[selectedIndex].Y.ToString();
panel1.Invalidate();
}