mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 07:48:12 +08:00
Implement bounds input to constrain the output frame of the brush node
Test Plan: Hook up a constraint to the brush node in the editor and verify the result looks correct Reviewers: Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1195
This commit is contained in:
committed by
Keavon Chambers
parent
3adcc3031a
commit
36f24b7730
+1
@@ -470,6 +470,7 @@ fn static_nodes() -> Vec<DocumentNodeType> {
|
||||
inputs: vec![
|
||||
DocumentInputType::value("None", TaggedValue::None, false),
|
||||
DocumentInputType::value("Background", TaggedValue::ImageFrame(ImageFrame::empty()), true),
|
||||
DocumentInputType::value("Bounds", TaggedValue::ImageFrame(ImageFrame::empty()), true),
|
||||
DocumentInputType::value("Trace", TaggedValue::VecDVec2((0..2).map(|x| DVec2::new(x as f64 * 10., 0.)).collect()), true),
|
||||
DocumentInputType::value("Diameter", TaggedValue::F64(40.), false),
|
||||
DocumentInputType::value("Hardness", TaggedValue::F64(50.), false),
|
||||
|
||||
+4
-4
@@ -588,11 +588,11 @@ pub fn blur_image_properties(document_node: &DocumentNode, node_id: NodeId, _con
|
||||
}
|
||||
|
||||
pub fn brush_node_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||
let color = color_widget(document_node, node_id, 6, "Color", ColorInput::default(), true);
|
||||
let color = color_widget(document_node, node_id, 7, "Color", ColorInput::default(), true);
|
||||
|
||||
let size = number_widget(document_node, node_id, 3, "Diameter", NumberInput::default().min(1.).max(100.).unit(" px"), true);
|
||||
let hardness = number_widget(document_node, node_id, 4, "Hardness", NumberInput::default().min(0.).max(100.).unit("%"), true);
|
||||
let flow = number_widget(document_node, node_id, 5, "Flow", NumberInput::default().min(1.).max(100.).unit("%"), true);
|
||||
let size = number_widget(document_node, node_id, 4, "Diameter", NumberInput::default().min(1.).max(100.).unit(" px"), true);
|
||||
let hardness = number_widget(document_node, node_id, 5, "Hardness", NumberInput::default().min(0.).max(100.).unit("%"), true);
|
||||
let flow = number_widget(document_node, node_id, 6, "Flow", NumberInput::default().min(1.).max(100.).unit("%"), true);
|
||||
|
||||
vec![color, LayoutGroup::Row { widgets: size }, LayoutGroup::Row { widgets: hardness }, LayoutGroup::Row { widgets: flow }]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user