* Several fixes 4.x-dev

Thu, 27 May 2021 16:22:02 +0300

author
cemkalyoncu
date
Thu, 27 May 2021 16:22:02 +0300
branch
4.x-dev
changeset 1689
24a4c8817968
parent 1688
fd16ff398275
child 1690
43b08e17672d

* Several fixes

Source/Gorgon/CGI/Bezier.h file | annotate | diff | comparison | revisions
Source/Gorgon/Graphics/Bitmap.h file | annotate | diff | comparison | revisions
--- a/Source/Gorgon/CGI/Bezier.h	Sun May 23 13:48:02 2021 +0300
+++ b/Source/Gorgon/CGI/Bezier.h	Thu May 27 16:22:02 2021 +0300
@@ -1,6 +1,7 @@
 #pragma once
 
 #include "../Geometry/Point.h"
+#include "../Geometry/PointList.h"
 #include "../Geometry/Size.h"
 
 namespace Gorgon { namespace CGI {
@@ -102,7 +103,8 @@
                 auto seg = segments.back();
                 Geometry::Line<Point_> l(seg.P0, seg.P3);
                 
-                Float d = l.Distance(seg.P1) + l.Distance(seg.P2);
+                
+                Float d = (seg.P1 == seg.P2) ? 0 : l.Distance(seg.P1) + l.Distance(seg.P2);
                 
                 segments.pop_back();
                 
--- a/Source/Gorgon/Graphics/Bitmap.h	Sun May 23 13:48:02 2021 +0300
+++ b/Source/Gorgon/Graphics/Bitmap.h	Thu May 27 16:22:02 2021 +0300
@@ -317,7 +317,7 @@
 		/// Provides access to the given component in x and y coordinates. This
 		/// function returns 0 if the given coordinates are out of bounds. This
 		/// function works slower than the () operator.
-		Byte Get(const Geometry::Point &p, Byte def, unsigned component = 0) const {
+		Byte Get(const Geometry::Point &p, Byte def, unsigned component) const {
 			ASSERT(data, "Data is not set");
 			return data->Get(p, def, component);
 		}

mercurial