Improved mask also work on erase. Improved shaders for layer opacity, now when drawing doesn't change opacity. Improved layers panel layout to be similar to PS. Added layer blending option and visibility. Added custom icons to checkboxes and fixed the combobox items.
This commit is contained in:
@@ -105,3 +105,19 @@ void NodeImage::draw()
|
||||
TextureManager::get(m_tex_id).unbind();
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
bool NodeImage::set_image(const std::string& path)
|
||||
{
|
||||
m_path = path;
|
||||
m_tex_id = const_hash(path.c_str());
|
||||
if (!m_path.empty() && TextureManager::load(m_path.c_str(), m_use_mipmaps))
|
||||
{
|
||||
auto tex_sz = TextureManager::get(m_tex_id).size();
|
||||
m_off = xy(m_region) / tex_sz;
|
||||
m_sz = (zw(m_region) - xy(m_region)) / tex_sz;
|
||||
if (m_autosize)
|
||||
SetAspectRatio(tex_sz.x / tex_sz.y);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user