Settings, Hotkey bugfix.

null errors.
This commit is contained in:
max 2019-03-31 18:45:16 +02:00
parent 82efcbb6d0
commit 7990f987dc
2 changed files with 16 additions and 13 deletions

View File

@ -211,7 +211,7 @@ namespace MA_TextureAtlasserPro
{
if(atlas != null && atlas.selectedTextureQuad != null)
{
CreateTextureQuad(atlas, namePrefix + atlas.selectedTextureQuad.name, atlas.selectedTextureQuad.rect);
CreateTextureQuad(atlas, namePrefix + atlas.selectedTextureQuad.name, atlas.selectedTextureQuad.rect, false);
if(copyData)
{

View File

@ -92,6 +92,8 @@ namespace MA_TextureAtlasserPro
//Hotkeys.
if (curWindow.settings.useHotkeys)
{
if(curWindow.textureAtlas != null)
{
if (e.type == EventType.KeyDown && e.keyCode == curWindow.settings.addQuadHotKey)
{
@ -109,12 +111,13 @@ namespace MA_TextureAtlasserPro
if (e.type == EventType.KeyDown && e.keyCode == curWindow.settings.duplicateHotKey)
{
MA_TextureAtlasserProUtils.DuplicateTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus);
MA_TextureAtlasserProUtils.DuplicateTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus, curWindow.settings.copySelectedQuadData, curWindow.settings.duplicatedQuadNamePrefix);
e.Use();
}
}
}
}
}
private Vector2 ConvertScreenCoordsToZoomCoords(Vector2 screenCoords)
{