Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/21/15 14:18:31 (9 years ago)
Author:
jkarder
Message:

#1265: merged changes from abeham

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/Primitives/AxisPrimitiveBase.cs

    r12535 r13045  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2522using System.Drawing;
    2623
     
    4138        if (value != myShowGrid) {
    4239          myShowGrid = value;
    43           OnUpdate();
     40          OnRedrawRequired();
    4441        }
    4542      }
     
    5148        if (value != myHorizontalLabel) {
    5249          myHorizontalLabel = value;
    53           OnUpdate();
     50          OnRedrawRequired();
    5451        }
    5552      }
     
    6158        if (value != myVerticalLabel) {
    6259          myVerticalLabel = value;
    63           OnUpdate();
     60          OnRedrawRequired();
    6461        }
    6562      }
     
    6764
    6865    protected AxisPrimitiveBase(IChart chart, PointD point, AxisType axisType)
    69       : base(chart) {
    70       Brush = Brushes.Black;
    71       myPoint = point;
    72       myAxisType = axisType;
    73       myShowGrid = true;
    74     }
    75     protected AxisPrimitiveBase(IChart chart, double x, double y, AxisType axisType)
    76       : this(chart, new PointD(x, y), axisType) {
    77     }
     66      : this(chart, point, axisType, Pens.Black, Brushes.Black) { }
    7867    protected AxisPrimitiveBase(IChart chart, PointD point, AxisType axisType, Pen pen, Brush brush)
    7968      : base(chart, pen, brush) {
     
    8271      myShowGrid = true;
    8372    }
    84     protected AxisPrimitiveBase(IChart chart, double x, double y, AxisType axisType, Pen pen, Brush brush)
    85       : this(chart, new PointD(x, y), axisType, pen, brush) {
    86     }
    8773
    8874    public virtual void SetPosition(PointD point) {
    8975      myPoint = point;
    90       OnUpdate();
     76      OnRedrawRequired();
    9177    }
    92     public void SetPosition(double x, double y) {
    93       SetPosition(new PointD(x, y));
    94     }
     78
    9579    public override void Move(Offset delta) {
    9680      SetPosition(Point + delta);
    9781    }
    9882
     83    public override void Move(PointD point, Offset delta) {
     84      Move(delta);
     85    }
     86
     87    public override void SnapToGrid(IGrid grid) {
     88      Move(grid.GetBottomLeftGridPoint(myPoint) - myPoint);
     89    }
     90
     91    public override void SnapToGrid(PointD point, IGrid grid) {
     92      SnapToGrid(grid);
     93    }
     94
    9995    public override bool ContainsPoint(PointD point) {
    100       SizeD size = Chart.TransformPixelToWorld(new Size(5, 5));
     96      var size = Chart.TransformPixelToWorld(new Size(5, 5));
    10197      bool result = false;
    10298      if ((AxisType & AxisType.Horizontal) == AxisType.Horizontal)
Note: See TracChangeset for help on using the changeset viewer.