mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 17:18:13 +08:00
Remove code for the deprecated and unused Curve type (#4127)
* Remove the unused Curve type * Fix frontend
This commit is contained in:
@@ -19,7 +19,6 @@ use graphene_std::ATTR_TRANSFORM;
|
||||
use graphene_std::NodeInputDecleration;
|
||||
use graphene_std::animation::RealTimeMode;
|
||||
use graphene_std::extract_xy::XY;
|
||||
use graphene_std::raster::curve::Curve;
|
||||
use graphene_std::raster::{
|
||||
BlendMode, CellularDistanceFunction, CellularReturnType, Color, DomainWarpType, FractalType, LuminanceCalculation, NoiseType, RedGreenBlue, RedGreenBlueAlpha, RelativeAbsolute,
|
||||
SelectiveColorChoice,
|
||||
@@ -223,7 +222,6 @@ pub(crate) fn property_from_type(
|
||||
// STRUCT TYPES
|
||||
// ============
|
||||
Some(x) if x == TypeId::of::<Font>() => font_widget(default_info),
|
||||
Some(x) if x == TypeId::of::<Curve>() => curve_widget(default_info),
|
||||
Some(x) if x == TypeId::of::<Footprint>() => footprint_widget(default_info, &mut extra_widgets),
|
||||
Some(x) if x == TypeId::of::<Box<VectorModification>>() => vector_modification_widget(default_info).into(),
|
||||
Some(x) if x == TypeId::of::<Image<Color>>() => image_data_widget(default_info).into(),
|
||||
@@ -1198,27 +1196,27 @@ pub fn font_widget(parameter_widgets_info: ParameterWidgetsInfo) -> LayoutGroup
|
||||
font_widgets.into_iter().chain(style_widgets.unwrap_or_default()).collect::<Vec<_>>().into()
|
||||
}
|
||||
|
||||
pub fn curve_widget(parameter_widgets_info: ParameterWidgetsInfo) -> LayoutGroup {
|
||||
let ParameterWidgetsInfo { document_node, node_id, index, .. } = parameter_widgets_info;
|
||||
// pub fn curve_widget(parameter_widgets_info: ParameterWidgetsInfo) -> LayoutGroup {
|
||||
// let ParameterWidgetsInfo { document_node, node_id, index, .. } = parameter_widgets_info;
|
||||
|
||||
let mut widgets = start_widgets(parameter_widgets_info);
|
||||
// let mut widgets = start_widgets(parameter_widgets_info);
|
||||
|
||||
let Some(document_node) = document_node else { return LayoutGroup::default() };
|
||||
let Some(input) = document_node.inputs.get(index) else {
|
||||
log::warn!("A widget failed to be built because its node's input index is invalid.");
|
||||
return LayoutGroup::row(vec![]);
|
||||
};
|
||||
if let Some(TaggedValue::Curve(curve)) = &input.as_non_exposed_value() {
|
||||
widgets.extend_from_slice(&[
|
||||
Separator::new(SeparatorStyle::Unrelated).widget_instance(),
|
||||
CurveInput::new(curve.clone())
|
||||
.on_update(update_value(|x: &CurveInput| TaggedValue::Curve(x.value.clone()), node_id, index))
|
||||
.on_commit(commit_value)
|
||||
.widget_instance(),
|
||||
])
|
||||
}
|
||||
LayoutGroup::row(widgets)
|
||||
}
|
||||
// let Some(document_node) = document_node else { return LayoutGroup::default() };
|
||||
// let Some(input) = document_node.inputs.get(index) else {
|
||||
// log::warn!("A widget failed to be built because its node's input index is invalid.");
|
||||
// return LayoutGroup::row(vec![]);
|
||||
// };
|
||||
// if let Some(TaggedValue::Curve(curve)) = &input.as_non_exposed_value() {
|
||||
// widgets.extend_from_slice(&[
|
||||
// Separator::new(SeparatorStyle::Unrelated).widget_instance(),
|
||||
// CurveInput::new(curve.clone())
|
||||
// .on_update(update_value(|x: &CurveInput| TaggedValue::Curve(x.value.clone()), node_id, index))
|
||||
// .on_commit(commit_value)
|
||||
// .widget_instance(),
|
||||
// ])
|
||||
// }
|
||||
// LayoutGroup::row(widgets)
|
||||
// }
|
||||
|
||||
pub fn get_document_node<'a>(node_id: NodeId, context: &'a NodePropertiesContext<'a>) -> Result<&'a DocumentNode, String> {
|
||||
let network = context
|
||||
|
||||
Reference in New Issue
Block a user