fixed drag drop to 3d view

This commit is contained in:
Lars Brubaker 2023-09-29 11:42:19 -07:00
parent 35db9e6867
commit f9dbf74fcd
4 changed files with 14 additions and 3 deletions

View file

@ -74,4 +74,15 @@ namespace MatterHackers.MatterControl.Library
return Task.FromResult<StreamAndLength>(null);
}
}
/// <summary>
/// This class is specifically used for drag drop of scene replacement files
/// </summary>
public class SceneReplacementFileItem : FileSystemFileItem
{
public SceneReplacementFileItem(string filePath)
: base(filePath)
{
}
}
}

View file

@ -1233,7 +1233,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
if ((firstItem is ILibraryAssetStream contentStream
&& contentStream.ContentType == "gcode")
|| firstItem is FileSystemFileItem)
|| firstItem is SceneReplacementFileItem)
{
DragDropObject = null;
this.SceneReplacement = firstItem as ILibraryAssetStream;

View file

@ -610,7 +610,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
int maxItemWidth = 0;
var recentFiles = new DirectoryInfo(ApplicationDataStorage.Instance.PlatingDirectory).GetFiles("*.mcx").OrderByDescending(f => f.LastWriteTime);
foreach (var item in recentFiles.Where(f => f.Length > 215).Select(f => new FileSystemFileItem(f.FullName)).Take(12))
foreach (var item in recentFiles.Where(f => f.Length > 215).Select(f => new SceneReplacementFileItem(f.FullName)).Take(12))
{
var imageBuffer = new ImageBuffer(thumbWidth, thumbWidth);

@ -1 +1 @@
Subproject commit bb22b896576d4871774b966af45546b3509edf9a
Subproject commit ccb6fd61762931e024e0517e287925560c835c9e