* Couple of fixes 4.x-dev

Sun, 23 May 2021 13:32:34 +0300

author
cemkalyoncu
date
Sun, 23 May 2021 13:32:34 +0300
branch
4.x-dev
changeset 1687
dc9150a2185d
parent 1686
5fc838d40d0f
child 1688
fd16ff398275

* Couple of fixes

Source/Gorgon/Containers/Collection.h file | annotate | diff | comparison | revisions
Source/Gorgon/Geometry/Size.h file | annotate | diff | comparison | revisions
Source/Gorgon/Graphics/Color.h file | annotate | diff | comparison | revisions
Source/Gorgon/String.h file | annotate | diff | comparison | revisions
--- a/Source/Gorgon/Containers/Collection.h	Sat May 22 22:31:59 2021 +0300
+++ b/Source/Gorgon/Containers/Collection.h	Sun May 23 13:32:34 2021 +0300
@@ -398,7 +398,7 @@
                 else if(before==list.size()) {
                     T_ *t=list[index];
 
-                    for(long i=index; i<list.size()-1; i++)
+                    for(long i=index; i<(long)list.size()-1; i++)
                         list[i]=list[i+1];
 
                     list[list.size()-1]=t;
--- a/Source/Gorgon/Geometry/Size.h	Sat May 22 22:31:59 2021 +0300
+++ b/Source/Gorgon/Geometry/Size.h	Sun May 23 13:32:34 2021 +0300
@@ -273,6 +273,12 @@
 		return operator*(size, factor);
 	}
 
+	/// Multiplies a size with a scalar, effectively resizing it.
+	template<class T_, class O_>
+	basic_Size<T_> operator *(const basic_Size<T_> &size, const basic_Size<O_> &other) {
+		return{T_(size.Width*other.Width), T_(size.Height*other.Height)};
+	}
+
 	/// Divides a size with a scalar, effectively resizing it.
 	template<class T_>
 	basic_Size<T_> operator /(const basic_Size<T_> &size, double factor) {
@@ -285,6 +291,12 @@
 		return operator/(size, factor);
 	}
 
+	/// Multiplies a size with a scalar, effectively resizing it.
+	template<class T_, class O_>
+	basic_Size<T_> operator /(const basic_Size<T_> &size, const basic_Size<O_> &other) {
+		return{T_(size.Width/other.Width), T_(size.Height/other.Height)};
+	}
+
 	/// Writes the given size object to the stream. Width and Height components of
 	/// size objects are separated by an x
 	template<class T_>
--- a/Source/Gorgon/Graphics/Color.h	Sat May 22 22:31:59 2021 +0300
+++ b/Source/Gorgon/Graphics/Color.h	Sun May 23 13:32:34 2021 +0300
@@ -230,7 +230,7 @@
 
         /// Compares two colors
         bool operator==(const RGBA &other) const {
-            return (int)(*this) == (uint32_t)other;
+            return (uint32_t)(*this) == (uint32_t)other;
         }
 
         /// Compares two colors
--- a/Source/Gorgon/String.h	Sat May 22 22:31:59 2021 +0300
+++ b/Source/Gorgon/String.h	Sun May 23 13:32:34 2021 +0300
@@ -593,7 +593,7 @@
         }
         
         inline int UnicodeGlyphCount(const std::string &s) {
-            int i = 0;
+            size_t i = 0;
             int count = 0;
             while(i < s.length()) {
                 count++;

mercurial