make brushes square when imported from ABR
This commit is contained in:
@@ -120,7 +120,7 @@ Image Image::resize_power2() const
|
||||
return resize(w, h);
|
||||
}
|
||||
|
||||
Image Image::resize_squared() const
|
||||
Image Image::resize_squared(const glm::u8vec4& bg) const
|
||||
{
|
||||
Image ret;
|
||||
if (width == height)
|
||||
@@ -146,7 +146,7 @@ Image Image::resize_squared() const
|
||||
ret.create(size, size);
|
||||
auto ptr_src = reinterpret_cast<glm::u8vec4*>(m_data.get());
|
||||
auto ptr_dst = reinterpret_cast<glm::u8vec4*>(ret.m_data.get());
|
||||
std::fill_n(ptr_dst, size * size, glm::u8vec4(0));
|
||||
std::fill_n(ptr_dst, size * size, bg);
|
||||
for (int y = 0; y < height; y++)
|
||||
std::copy_n(ptr_src + y * width, width, ptr_dst + pad_x + (y + pad_y) * ret.width);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user