Ver Fonte

Fixed file path when writing with relative names.

Vicente Penades há 5 anos atrás
pai
commit
a20694b82a
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      src/SharpGLTF.Core/IO/WriteContext.cs

+ 2 - 0
src/SharpGLTF.Core/IO/WriteContext.cs

@@ -41,6 +41,8 @@ namespace SharpGLTF.IO
         {
             Guard.FilePathMustBeValid(filePath, nameof(filePath));
 
+            if (!Path.IsPathRooted(filePath)) filePath = Path.GetFullPath(filePath);
+
             var dir = Path.GetDirectoryName(filePath);
 
             return CreateFromDirectory(dir);