Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/02/09 22:03:41 (15 years ago)
Author:
mstoeger
Message:

Transformations on shapes are possible outside of the Draw method. (#424)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/CompositeShape.cs

    r1234 r1240  
    55namespace HeuristicLab.Visualization {
    66  public class CompositeShape : IShape {
     7    private IShape parent;
     8
    79    protected readonly List<IShape> shapes = new List<IShape>();
    810    protected RectangleD boundingBox = RectangleD.Empty;
    911
    10     public virtual void Draw(Graphics graphics, Rectangle parentViewport, RectangleD parentClippingArea) {
     12    public virtual void Draw(Graphics graphics) {
    1113      foreach (IShape shape in shapes) {
    12         shape.Draw(graphics, parentViewport, parentClippingArea);
     14        shape.Draw(graphics);
    1315      }
    1416    }
     
    2426    }
    2527
     28    public RectangleD ClippingArea {
     29      get { return Parent.ClippingArea; }
     30    }
     31
     32    public Rectangle Viewport {
     33      get { return Parent.Viewport; }
     34    }
     35
     36    public IShape Parent {
     37      get { return parent; }
     38      set { parent = value; }
     39    }
     40
    2641    public void ClearShapes() {
    2742      shapes.Clear();
     
    3045
    3146    public void AddShape(IShape shape) {
     47      shape.Parent = this;
     48
    3249      if (shapes.Count == 0) {
    3350        boundingBox = shape.BoundingBox;
Note: See TracChangeset for help on using the changeset viewer.