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/Structs/PointD.cs

    r12535 r13045  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2523using System.Drawing;
    2624
     
    8684    }
    8785    public static bool operator !=(PointD point1, PointD point2) {
    88       return (point1.X != point2.X) && (point1.Y != point2.Y);
     86      return !(point1 == point2);
     87    }
     88    public static explicit operator Point(PointD point) {
     89      return new Point((int)Math.Round(point.X), (int)Math.Round(point.Y));
     90    }
     91    public static explicit operator PointF(PointD point) {
     92      float fx = (float)point.X;
     93      float fy = (float)point.Y;
     94      return new PointF(float.IsPositiveInfinity(fx) ? float.MaxValue : fx, float.IsNegativeInfinity(fy) ? float.MinValue : fy);
    8995    }
    9096    public static explicit operator SizeD(PointD point) {
Note: See TracChangeset for help on using the changeset viewer.