Merge 4.x-dev

Fri, 16 Jul 2021 09:18:57 +0300

author
yakupbeyoglu
date
Fri, 16 Jul 2021 09:18:57 +0300
branch
4.x-dev
changeset 1721
d969488f5f06
parent 1720
229fcfacb5cb (current diff)
parent 1719
2194cd4edde7 (diff)
child 1722
ac75a1494fa5

Merge

--- a/Source/Gorgon/Geometry/Bounds.h	Fri Jul 16 09:18:47 2021 +0300
+++ b/Source/Gorgon/Geometry/Bounds.h	Fri Jul 16 09:18:57 2021 +0300
@@ -807,13 +807,33 @@
 			bounds.Bottom= T_( bounds.Bottom+ (bounds.Left  -origin.X)*rate );
 		}
 	}
+	
+	///Reflects the bounds along X axis
 	template <class T_>
 	void MirrorX(basic_Bounds<T_> &bounds){
         bounds.Right = -bounds.Right;
+        if(bounds.Left>bounds.Right) std::swap(bounds.Left,bounds.Right);
     }
+    
+    ///Reflects the bounds along Y axis
     template <class T_>
     void MirrorY(basic_Bounds<T_> &bounds){
         bounds.Bottom = -bounds.Bottom;
+        if(bounds.Top>bounds.Bottom) std::swap(bounds.Top,bounds.Bottom);
+    }
+    
+    ///Flips the bounds along Y axis
+    template <class T_>
+	void FlipX(basic_Bounds<T_> &bounds){
+        bounds.Bottom= -bounds.Bottom;
+        if(bounds.Top>bounds.Bottom) std::swap(bounds.Top,bounds.Bottom);
+    }
+    
+    ///Flips the bounds along X axis
+    template <class T_>
+    void FlipY(basic_Bounds<T_> &bounds){
+        bounds.Right = -bounds.Right;
+        if(bounds.Left>bounds.Right) std::swap(bounds.Left,bounds.Right);
     }
 	
 	/// @see basic_Bounds
--- a/Source/Gorgon/Geometry/Point.h	Fri Jul 16 09:18:47 2021 +0300
+++ b/Source/Gorgon/Geometry/Point.h	Fri Jul 16 09:18:57 2021 +0300
@@ -552,14 +552,14 @@
 		
 		/// Reflects the given point along the X axis
 		template<class T_>
-		void MirrorX(basic_Point<T_> &point) {
-			point.Y = -point.Y;
+		void FlipX(basic_Point<T_> &point) {
+			point.X = -point.X;
 		}
 
 		/// Reflects the given point along the Y axis
 		template<class T_>
-		void MirrorY(basic_Point<T_> &point) {
-			point.X = -point.X;
+		void FlipY(basic_Point<T_> &point) {
+			point.Y = -point.Y;
 		}
 
 		/// Reflects the given point horizontally
--- a/Source/Gorgon/Graphics/AdvancedPrinterImpl.h	Fri Jul 16 09:18:47 2021 +0300
+++ b/Source/Gorgon/Graphics/AdvancedPrinterImpl.h	Fri Jul 16 09:18:57 2021 +0300
@@ -932,6 +932,7 @@
             ind = acc.size();
             newline = ind == 0;
 
+            int regionendy = cur.Y + lineh;
             if(nl != -1)
                 cur.Y += lineh;
 
@@ -948,7 +949,7 @@
                     r.startat = -1;
                 }
 
-                r.Bounds.Bottom = cur.Y;
+                r.Bounds.Bottom = regionendy;
                 r.Bounds.Top = starty;
 
                 if(r.finishat != -1 && r.finishat <= end) {
@@ -965,7 +966,7 @@
                     regions.push_back(r);
 
                     r.Bounds.Left = nextlinexstart;
-                    r.Bounds.Top = cur.Y;
+                    r.Bounds.Top = regionendy;
 
                     if(r.finishat != -1) {
                         r.finishat -= end;
--- a/Source/Gorgon/String/Markdown.cpp	Fri Jul 16 09:18:47 2021 +0300
+++ b/Source/Gorgon/String/Markdown.cpp	Fri Jul 16 09:18:57 2021 +0300
@@ -21,6 +21,9 @@
                 return acc;
             
             String::AppendUnicode(acc, g);
+
+            if(it == end)
+                --it;
         }
         
         return acc;
@@ -78,7 +81,7 @@
             spaceadded = false;
         };
         
-        for(auto it = text.begin(); it!=end; ++it) {
+        for(auto it = text.begin(); it!=end; (it!= end) ? ++it : it) {
             prev = g;
             g = internal::decode_impl(it, end);
             
--- a/Source/Gorgon/Widgets/Inputbox.cpp	Fri Jul 16 09:18:47 2021 +0300
+++ b/Source/Gorgon/Widgets/Inputbox.cpp	Fri Jul 16 09:18:57 2021 +0300
@@ -184,6 +184,9 @@
             updateselection();
         }
         
+        changed();
+        dirty = false;
+
         return true;
     }
 
@@ -219,9 +222,6 @@
                 case Keycodes::Numpad_Enter:
                     if(!readonly) {
                         Done();
-                        
-                        changed();
-                        dirty = false;
                     }
                     
                     return blockenter;
--- a/Source/Gorgon/Widgets/Label.cpp	Fri Jul 16 09:18:47 2021 +0300
+++ b/Source/Gorgon/Widgets/Label.cpp	Fri Jul 16 09:18:57 2021 +0300
@@ -114,10 +114,11 @@
                 
                 for(auto &r : regions) {
                     if(IsInside(r.Bounds, point)) {
+                        Focus();
                         if(links.size() > r.ID) {
                             auto &dest = links[r.ID].Destination;
                             if(dest.substr(0, 1) == "#") {
-                                if(!inpagehandler || !inpagehandler(dest))
+                                if((!inpagehandler || !inpagehandler(dest)) && UI::InPageHandler)
                                     UI::InPageHandler(dest);
                             }
                             else {
--- a/Source/Gorgon/Widgets/Panel.h	Fri Jul 16 09:18:47 2021 +0300
+++ b/Source/Gorgon/Widgets/Panel.h	Fri Jul 16 09:18:57 2021 +0300
@@ -72,6 +72,13 @@
         }
         
         
+        virtual bool Done() override {
+            if(HasFocusedWidget())
+                return GetFocus().Done();
+
+            return false;
+        }
+
         using Widget::EnsureVisible;
         
         bool EnsureVisible(const UI::Widget &widget) override;

mercurial