Erase the existing background (including any lines) before drawing a box. This allows boxes to be placed over curves and lines.

Change the order of lines being drawn to support boxes being able to be placed on top of curves and lines.
This commit is contained in:
Rich 2013-10-24 21:47:01 +00:00
parent cc60d4ff46
commit 5271561b84
2 changed files with 11 additions and 4 deletions

View File

@ -34,7 +34,12 @@ namespace VG
public void DrawLine(Pen pn, float startx, float starty, float endx, float endy)
{ _VGOutput.DrawLine(pn, startx, starty, endx, endy); }
public void DrawRectangle(Pen pn, RectangleF rectf)
{ _VGOutput.DrawRectangle(pn, rectf.X, rectf.Y, rectf.Width, rectf.Height); }
{
_VGOutput.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy;
_VGOutput.FillRectangle(Brushes.Transparent, rectf.X, rectf.Y, rectf.Width, rectf.Height);
_VGOutput.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
_VGOutput.DrawRectangle(pn, rectf.X, rectf.Y, rectf.Width, rectf.Height);
}
public void DrawEllipse(Pen pn, float cx, float cy, float dx, float dy)
{ _VGOutput.DrawEllipse(pn, cx, cy, dx, dy); }
public void DrawImage(Bitmap bm, RectangleF rectf)

View File

@ -721,6 +721,8 @@ namespace XYPlots
Position[X] = 0;
Position[Y] = 0; // printerunits[Y];
SavePosition();
SetPenDiameter(5);
BoxRelative(printerunits[X], printerunits[Y], CurPenWidth, pg, vgOutput);
if (GridOnFlag == 0) Visible = 0;
//if (vgOutput is VGOut_Graphics)
//{
@ -741,8 +743,8 @@ namespace XYPlots
Visible = 1;
RecallPosition();
// Draw outline last to overlap any grid lines.
SetPenDiameter(5);
BoxRelative(printerunits[X], printerunits[Y], CurPenWidth, pg, vgOutput);
//SetPenDiameter(5);
//BoxRelative(printerunits[X], printerunits[Y], CurPenWidth, pg, vgOutput);
}
private void DoGrid(int flag, VG.Page pg, IVGOutput vgOutput)
{
@ -1940,8 +1942,8 @@ namespace XYPlots
VG.Page pg = new Page(true, _LeftMargin, _TopMargin, _RightMargin, _BottomMargin);
GenerateGrid(pg, vgOutput);
DoAxisTitles(pg, vgOutput);
DoBoxes(pg, vgOutput);
DrawLines(pg, vgOutput);
DoBoxes(pg, vgOutput);
FreeBoxList();
FreeLineList();
CloseGraph();