fix floating panels and iOS export picking

This commit is contained in:
2019-09-19 23:02:46 +02:00
parent 70fa29839e
commit abaf82ba24
12 changed files with 90 additions and 35 deletions

View File

@@ -693,9 +693,9 @@ bool NodePanelBrushPreset::export_ppbr(const std::string& path, const PPBRInfo&
auto base = m[1].str();
auto name = m[2].str();
auto ext = m[3].str();
std::string out_path = base + "/" + name;
std::string out_path = base + "/" + name + "_data";
Asset::create_dir(out_path);
bool path_created = Asset::create_dir(out_path);
std::ofstream f(path, std::ios::binary);
if (f.good())
@@ -744,7 +744,8 @@ bool NodePanelBrushPreset::export_ppbr(const std::string& path, const PPBRInfo&
if (has_header_image)
{
sw << *info_data.header_image;
info_data.header_image->save_jpg(out_path + "/header.jpg", 75);
if (path_created)
info_data.header_image->save_jpg(out_path + "/header.jpg", 75);
}
pb->increment();
@@ -762,7 +763,8 @@ bool NodePanelBrushPreset::export_ppbr(const std::string& path, const PPBRInfo&
Image img = pr->render_to_image();
img.file_name = pr->m_brush->m_name;
sw << img;
img.save_jpg(fmt::format(out_path + "/thumb-{:04d}.jpg", thumb_counter), 75);
if (path_created)
img.save_jpg(fmt::format(out_path + "/thumb-{:04d}.jpg", thumb_counter), 75);
thumb_counter++;
pb->increment();
}