Hello Mikhail,
I didn't find the EntitiesCreator.Disable method where you mentioned, but after some research inside the CADEditor I found the code I postet at the bottom of this post (taken form CadEditorDemo)
Inside the method below i found this part.
Code: Select all
if ((!this.clipRectangle.Enabled) && (!this.CreateNewEntity))
{
LeftImagePosition -= (cX - e.X);
TopImagePosition -= (cY - e.Y);
cadPictBox.Invalidate();
}
It prevents moving the drawing when CreateNewEntity is true. Simply removing the (!this.CreateNewEntity) didn't work because the traces were drawn not where the traces should be...
Thank you for your help,
Roman
Code: Select all
private void cadPictBox_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (cadImage == null)
return;
if (!this.cadPictBox.Focused)
{
this.cadPictBox.Focus();
this.cadPictBox.Invalidate();
}
if ((!stopSnap) && (this.cadPictBox.ClientRectangle.Contains(e.X, e.Y)))
{
RectangleF tmpRect = ImageRectangleF;
cadImage.DrawSnapTrace(e.X, e.Y, this.cadPictBox, tmpRect);
}
else
{
this.cadImage.RefreshSnapTrace(this.cadPictBox);
this.stopSnap = false;
}
if (detMouseDown)
{
if (e.Button != MouseButtons.Right)
{
if (ChangeEntityOnMouseMove(new Point(e.X, e.Y)))
return;
}
if ((!this.clipRectangle.Enabled) && (!this.CreateNewEntity))
{
LeftImagePosition -= (cX - e.X);
TopImagePosition -= (cY - e.Y);
cadPictBox.Invalidate();
}
cX = e.X;
cY = e.Y;
}
PreviousPosition = new PointF(e.X, e.Y);
DPoint vPt = GetRealPoint(e.X, e.Y, true);
stBar.Panels[2].Text = string.Format("{0} : {1} : 0", vPt.X, vPt.Y);
}