Remove code for the deprecated and unused Curve type (#4127)

* Remove the unused Curve type

* Fix frontend
This commit is contained in:
Keavon Chambers
2026-05-07 16:16:19 -07:00
committed by GitHub
parent 0834bff2da
commit dff8ac5511
10 changed files with 43 additions and 87 deletions
@@ -204,21 +204,6 @@ impl LayoutMessageHandler {
responses.add(callback_message);
}
Widget::CurveInput(curve_input) => {
let callback_message = match action {
WidgetValueAction::Commit => (curve_input.on_commit.callback)(&()),
WidgetValueAction::Update => {
let Some(curve) = serde_json::from_value(value).ok() else {
error!("CurveInput event data could not be deserialized");
return;
};
curve_input.value = curve;
(curve_input.on_update.callback)(curve_input)
}
};
responses.add(callback_message);
}
Widget::DropdownInput(dropdown_input) => {
let callback_message = match action {
WidgetValueAction::Commit => {
@@ -428,7 +428,6 @@ impl LayoutGroup {
let val = match &mut *widget.widget {
Widget::CheckboxInput(x) => &mut x.tooltip_description,
Widget::ColorInput(x) => &mut x.tooltip_description,
Widget::CurveInput(x) => &mut x.tooltip_description,
Widget::DropdownInput(x) => &mut x.tooltip_description,
Widget::IconButton(x) => &mut x.tooltip_description,
Widget::IconLabel(x) => &mut x.tooltip_description,
@@ -769,7 +768,6 @@ pub enum Widget {
ColorComparisonInput(ColorComparisonInput),
ColorInput(ColorInput),
ColorPresetsInput(ColorPresetsInput),
CurveInput(CurveInput),
DropdownInput(DropdownInput),
IconButton(IconButton),
IconLabel(IconLabel),
@@ -838,7 +836,6 @@ impl DiffUpdate {
Widget::ShortcutLabel(widget) => widget.shortcut.as_mut(),
Widget::IconLabel(_)
| Widget::ImageLabel(_)
| Widget::CurveInput(_)
| Widget::NodeCatalog(_)
| Widget::ReferencePointInput(_)
| Widget::RadioInput(_)
@@ -4,7 +4,6 @@ use crate::messages::layout::utility_types::widget_prelude::*;
use crate::messages::portfolio::document::node_graph::document_node_definitions::DefinitionIdentifier;
use derivative::*;
use graphene_std::Color;
use graphene_std::raster::curve::Curve;
use graphene_std::transform::ReferencePoint;
use graphene_std::vector::style::{FillChoice, GradientStops};
use graphite_proc_macros::WidgetBuilder;
@@ -420,30 +419,30 @@ pub struct TextInput {
pub on_commit: WidgetCallback<()>,
}
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
#[derive(Clone, serde::Serialize, serde::Deserialize, Derivative, WidgetBuilder)]
#[derivative(Debug, PartialEq, Default)]
pub struct CurveInput {
// Content
#[widget_builder(constructor)]
pub value: Curve,
// #[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
// #[derive(Clone, serde::Serialize, serde::Deserialize, Derivative, WidgetBuilder)]
// #[derivative(Debug, PartialEq, Default)]
// pub struct CurveInput {
// // Content
// #[widget_builder(constructor)]
// pub value: Curve,
// Tooltips
#[serde(rename = "tooltipLabel")]
pub tooltip_label: String,
#[serde(rename = "tooltipDescription")]
pub tooltip_description: String,
#[serde(rename = "tooltipShortcut")]
pub tooltip_shortcut: Option<ActionShortcut>,
// // Tooltips
// #[serde(rename = "tooltipLabel")]
// pub tooltip_label: String,
// #[serde(rename = "tooltipDescription")]
// pub tooltip_description: String,
// #[serde(rename = "tooltipShortcut")]
// pub tooltip_shortcut: Option<ActionShortcut>,
// Callbacks
#[serde(skip)]
#[derivative(Debug = "ignore", PartialEq = "ignore")]
pub on_update: WidgetCallback<CurveInput>,
#[serde(skip)]
#[derivative(Debug = "ignore", PartialEq = "ignore")]
pub on_commit: WidgetCallback<()>,
}
// // Callbacks
// #[serde(skip)]
// #[derivative(Debug = "ignore", PartialEq = "ignore")]
// pub on_update: WidgetCallback<CurveInput>,
// #[serde(skip)]
// #[derivative(Debug = "ignore", PartialEq = "ignore")]
// pub on_commit: WidgetCallback<()>,
// }
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
#[derive(Clone, Default, Derivative, serde::Serialize, serde::Deserialize, WidgetBuilder)]