public SHRect(SHRect rect) { left = rect.left; right = rect.right; bottom = rect.bottom; top = rect.top; }
public void Update(int width, int height) { plot = new SHRect(0, width, height, 0); title = new SHRect(plot); title.ShrinkTo(top: titleHeight); yLabel = new SHRect(plot); yLabel.ShrinkTo(left: yLabelWidth); yScale = new SHRect(plot); yScale.ShrinkTo(left: yScaleWidth); yScale.Shift(rightward: yLabel.Width); y2Label = new SHRect(plot); y2Label.ShrinkTo(right: y2LabelWidth); y2Scale = new SHRect(plot); y2Scale.ShrinkTo(right: y2ScaleWidth); y2Scale.Shift(rightward: -y2Label.Width); xLabel = new SHRect(plot); xLabel.ShrinkTo(bottom: xLabelHeight); xScale = new SHRect(plot); xScale.ShrinkTo(bottom: xScaleHeight); xScale.Shift(downward: -xLabel.Height); // the data rectangle is what is left over data = new SHRect(plot); data.ShrinkBy(top: title.Height); data.ShrinkBy(left: yLabel.Width + yScale.Width); data.ShrinkBy(right: y2Label.Width + y2Scale.Width); data.ShrinkBy(bottom: xLabel.Height + xScale.Height); // shrink labels and scales to match dataRect yLabel.MatchVert(data); yScale.MatchVert(data); y2Label.MatchVert(data); y2Scale.MatchVert(data); xLabel.MatchHoriz(data); xScale.MatchHoriz(data); // shrink the title to align it with the data area title.MatchHoriz(data); }
public void MatchHoriz(SHRect source) { left = source.left; right = source.right; }
public void MatchVert(SHRect source) { top = source.top; bottom = source.bottom; }