make brushes square when imported from ABR

This commit is contained in:
2019-02-11 00:45:53 +01:00
parent 6e41263600
commit 97c3ac0d19
5 changed files with 10 additions and 8 deletions

View File

@@ -77,8 +77,10 @@ void NodePanelBrush::init()
{
std::string path_high = App::I.data_path + "/brushes/" + samp.first + ".png";
std::string path_thumb = App::I.data_path + "/brushes/thumbs/" + samp.first + ".png";
samp.second->save(path_high);
auto thumb = samp.second->resize(64, 64);
auto padded = samp.second->resize_squared(glm::u8vec4(255));
auto high = padded.resize_power2();
high.save(path_high);
auto thumb = padded.resize(64, 64);
thumb.save(path_thumb);
async_start();
@@ -123,7 +125,7 @@ void NodePanelBrush::init()
std::string path_high = App::I.data_path + "/brushes/" + name + ".png";
std::string path_thumb = App::I.data_path + "/brushes/thumbs/" + name + ".png";
img = img.resize_squared();
img = img.resize_squared(glm::u8vec4(255));
img.gayscale_alpha();
auto thumb = img.resize(64, 64);