mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 06:48:12 +08:00
Add inpainting and outpainting to Imaginate (#864)
* Do not select layer immediatly on drag * Add LayerReferenceInput MVP widget * Properties Panel * Fix dragging marker flicker * Change mask shape to outline * Add mask rendering * Simplify select code * Remove colours * Fix inpaint/outpaint and rearrage widget UX * Add mask blur and mask starting fill parameters * Guard for the case when the layer is missing * Add icon to LayerReferenceInput to finalize its UI Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
5bf7b9fdf8
commit
9d80defa14
@@ -6,8 +6,10 @@ use crate::messages::prelude::*;
|
||||
|
||||
use graphene::color::Color;
|
||||
use graphene::layers::text_layer::Font;
|
||||
use graphene::LayerId;
|
||||
|
||||
use serde_json::Value;
|
||||
use std::ops::Not;
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct LayoutMessageHandler {
|
||||
@@ -117,6 +119,19 @@ impl<F: Fn(&MessageDiscriminant) -> Vec<KeysGroup>> MessageHandler<LayoutMessage
|
||||
let callback_message = (invisible.on_update.callback)(&());
|
||||
responses.push_back(callback_message);
|
||||
}
|
||||
Widget::LayerReferenceInput(layer_reference_input) => {
|
||||
let update_value = value.is_null().not().then(|| {
|
||||
value
|
||||
.as_str()
|
||||
.expect("LayerReferenceInput update was not of type: string")
|
||||
.split(',')
|
||||
.map(|id| id.parse::<LayerId>().unwrap())
|
||||
.collect::<Vec<_>>()
|
||||
});
|
||||
layer_reference_input.value = update_value;
|
||||
let callback_message = (layer_reference_input.on_update.callback)(layer_reference_input);
|
||||
responses.push_back(callback_message);
|
||||
}
|
||||
Widget::NumberInput(number_input) => match value {
|
||||
Value::Number(num) => {
|
||||
let update_value = num.as_f64().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user