* Size parsing fix 4.x-dev

Wed, 07 Oct 2020 09:41:58 +0300

author
cemkalyoncu
date
Wed, 07 Oct 2020 09:41:58 +0300
branch
4.x-dev
changeset 1459
f1d6091311ff
parent 1458
f087deb3bb72
child 1460
d0d48718575e

* Size parsing fix

Source/Gorgon/Geometry/Size.h file | annotate | diff | comparison | revisions
Testing/Source/Manual/UI_Generate.cpp file | annotate | diff | comparison | revisions
--- a/Source/Gorgon/Geometry/Size.h	Tue Oct 06 23:17:32 2020 +0300
+++ b/Source/Gorgon/Geometry/Size.h	Wed Oct 07 09:41:58 2020 +0300
@@ -50,9 +50,13 @@
 			auto s=str.begin();
 			
 			while(*s==' ' || *s=='\t') s++;
-			
-			Width=String::To<T_>(&str[s-str.begin()]);
-			
+            
+            auto pos = str.find_first_of('x', s-str.begin());
+            if(pos != str.npos)
+                Width=String::To<T_>(str.substr(s-str.begin(), pos-(s-str.begin())));
+            else
+                Width=String::To<T_>(&str[s-str.begin()]);
+            
 			while(s!=str.end() && *s!='x' && *s!=',') s++;
 			
 			if(*s=='x' || *s==',') s++;
--- a/Testing/Source/Manual/UI_Generate.cpp	Tue Oct 06 23:17:32 2020 +0300
+++ b/Testing/Source/Manual/UI_Generate.cpp	Wed Oct 07 09:41:58 2020 +0300
@@ -95,7 +95,7 @@
     
     radio.SetColumns(2);
 
-    Gorgon::Widgets::Inputbox<std::string> input;
+    Gorgon::Widgets::Sizefbox input;
 
     Gorgon::Widgets::Checkbox chk("Black",Gorgon::Widgets::Registry::Checkbox_Regular);
     Gorgon::Widgets::Checkbox chk2("Lattej");

mercurial