mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 04:28:11 +08:00
Switch the Color struct back to storing unassociated alpha (#4518)
* Switch Color struct back to storing unassociated alpha * Address review feedback * Update the Invert node and legacy image migration for straight alpha and add round-trip tests --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
e725f55043
commit
944d00cac5
@@ -2123,7 +2123,9 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
|
||||
_ => None,
|
||||
});
|
||||
|
||||
if let Some(image) = image {
|
||||
if let Some(mut image) = image {
|
||||
// Legacy embedded pixel data is premultiplied, so restore straight alpha before encoding it
|
||||
image.data.iter_mut().for_each(|pixel| *pixel = pixel.to_unassociated_alpha());
|
||||
let hash = document.resources.embedded.store(Resource::new(image.to_png()));
|
||||
|
||||
let resource_id = ResourceId::new();
|
||||
|
||||
Reference in New Issue
Block a user