Browse Source

VisualTests: Fix some issues with displaying tests.

Michael Ragazzon 5 years ago
parent
commit
52e1c3a990
3 changed files with 6 additions and 2 deletions
  1. 2 0
      Source/Core/FileInterface.cpp
  2. 2 2
      Tests/Source/VisualTests/TestViewer.cpp
  3. 2 0
      changelog.md

+ 2 - 0
Source/Core/FileInterface.cpp

@@ -66,6 +66,8 @@ bool FileInterface::LoadFile(const String& path, String& out_data)
 		Log::Message(Log::LT_WARNING, "Could only read %zu of %zu bytes from file %s", read_length, length, path.c_str());
 		Log::Message(Log::LT_WARNING, "Could only read %zu of %zu bytes from file %s", read_length, length, path.c_str());
 	}
 	}
 
 
+	Close(handle);
+
 	return true;
 	return true;
 }
 }
 
 

+ 2 - 2
Tests/Source/VisualTests/TestViewer.cpp

@@ -216,7 +216,7 @@ bool TestViewer::LoadTest(const Rml::String& directory, const Rml::String& filen
 		if (source_test.empty())
 		if (source_test.empty())
 			return false;
 			return false;
 
 
-		document_test = context->LoadDocumentFromMemory(source_test, filename);
+		document_test = context->LoadDocumentFromMemory(source_test, Rml::StringUtilities::Replace(test_path, ':', '|'));
 		if (!document_test)
 		if (!document_test)
 			return false;
 			return false;
 
 
@@ -239,7 +239,7 @@ bool TestViewer::LoadTest(const Rml::String& directory, const Rml::String& filen
 
 
 			if (!source_reference.empty())
 			if (!source_reference.empty())
 			{
 			{
-				document_reference = context->LoadDocumentFromMemory(source_reference, reference_filename);
+				document_reference = context->LoadDocumentFromMemory(source_reference, Rml::StringUtilities::Replace(reference_path, ':', '|'));
 				if (document_reference)
 				if (document_reference)
 				{
 				{
 					document_reference->SetProperty(PropertyId::Left, Property(510.f, Property::PX));
 					document_reference->SetProperty(PropertyId::Left, Property(510.f, Property::PX));

+ 2 - 0
changelog.md

@@ -136,6 +136,7 @@ Improved Lua plugin in several aspects.
 - Debugger improvements: Sort property names alphabetically. Fix a bug where the outlines would draw underneath the document.
 - Debugger improvements: Sort property names alphabetically. Fix a bug where the outlines would draw underneath the document.
 - Tabs and panels in tab sets will no longer set the `display` property to `inline-block`, thus it is now possible to customize the display property.
 - Tabs and panels in tab sets will no longer set the `display` property to `inline-block`, thus it is now possible to customize the display property.
 - Add `Rml::GetTextureSourceList()` function to list all image sources loaded in all documents. [#131](https://github.com/mikke89/RmlUi/issues/131)
 - Add `Rml::GetTextureSourceList()` function to list all image sources loaded in all documents. [#131](https://github.com/mikke89/RmlUi/issues/131)
+- RCSS and scripts are now always loaded in declared order [#144](https://github.com/mikke89/RmlUi/pull/144) (thanks @actboy168).
 
 
 ### Bug fixes
 ### Bug fixes
 
 
@@ -157,6 +158,7 @@ Improved Lua plugin in several aspects.
 - Tab set elements `tab` and `panel` should now have their `display` property set in the RCSS document, use `display: inline-block` for the same behavior as before.
 - Tab set elements `tab` and `panel` should now have their `display` property set in the RCSS document, use `display: inline-block` for the same behavior as before.
 - For custom, replaced elements: `Element::GetIntrinsicDimensions()` now additionally takes an intrinsic ratio parameter.
 - For custom, replaced elements: `Element::GetIntrinsicDimensions()` now additionally takes an intrinsic ratio parameter.
 - The `fill-image` property should now be applied to the \<progressbar\> element instead of its inner \<fill\> element.
 - The `fill-image` property should now be applied to the \<progressbar\> element instead of its inner \<fill\> element.
+- The function `ElementDocument::LoadScript` is now changed to handle internal and external scripts separately. [#144](https://github.com/mikke89/RmlUi/pull/144)
 
 
 
 
 ## RmlUi 3.3
 ## RmlUi 3.3