public virtual void PaintSelectionChrome(DGraphics dg) { if (Selected) { // save current transform DMatrix m = dg.SaveTransform(); // apply transform ApplyTransforms(dg, false); // draw selection rectangle DRect r = GetSelectRect(); double selectRectY = r.Y; dg.DrawRect(r.X, r.Y, r.Width, r.Height, DColor.White, 1, _controlScale); dg.DrawRect(r.X, r.Y, r.Width, r.Height, DColor.Black, 1, _controlScale, DStrokeStyle.Dot, DStrokeJoin.Mitre); if (Locked) PaintLockHandle(dg); else { // draw context handle PaintContextHandle(dg); // draw resize handle double hb = _handleBorder * _controlScale; double hb2 = hb + hb; r = GetResizeHandleRect(); if (hb != 0) r = r.Resize(hb, hb, -hb2, -hb2); dg.FillEllipse(r, DColor.Red); dg.DrawEllipse(r.X, r.Y, r.Width, r.Height, DColor.Black, 1, _controlScale, DStrokeStyle.Solid); // draw rotate handle r = GetRotateHandleRect(); if (hb != 0) r = r.Resize(hb, hb, -hb2, -hb2); DPoint p1 = r.Center; DPoint p2 = new DPoint(p1.X, selectRectY); dg.DrawLine(p1, p2, DColor.White, 1, DStrokeStyle.Solid, _controlScale, DStrokeCap.Butt); dg.DrawLine(p1, p2, DColor.Black, 1, DStrokeStyle.Dot, _controlScale, DStrokeCap.Butt); dg.FillEllipse(r, DColor.Blue); dg.DrawEllipse(r.X, r.Y, r.Width, r.Height, DColor.Black, 1, _controlScale, DStrokeStyle.Solid); } //r = GetEncompassingRect(); //dg.DrawRect(r.X, r.Y, r.Width, r.Height, DColor.Black, 1, Scale); // load previous transform dg.LoadTransform(m); } }
public override void PaintSelectionChrome(DGraphics dg) { if (Selected) { // save current transform DMatrix m = dg.SaveTransform(); // apply transform ApplyTransforms(dg, true); if (Locked) PaintLockHandle(dg); else { // draw context handle PaintContextHandle(dg); // draw pt handles double hb = _handleBorder * _controlScale; double hb2 = hb + hb; foreach (DPoint pt in Points) { DRect r = GetPtHandleRect(pt); if (hb != 0) r = r.Resize(hb, hb, -hb2, -hb2); dg.FillEllipse(r.X, r.Y, r.Width, r.Height, DColor.Red, 1); dg.DrawEllipse(r.X, r.Y, r.Width, r.Height, DColor.Black, 1, _controlScale, DStrokeStyle.Solid); } // view outline //dg.DrawRect(GetEncompassingRect(), DColor.Black); // load previous transform dg.LoadTransform(m); } } }