mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 18:28:12 +08:00
Remove code for the deprecated and unused Curve type (#4127)
* Remove the unused Curve type * Fix frontend
This commit is contained in:
@@ -204,21 +204,6 @@ impl LayoutMessageHandler {
|
|||||||
|
|
||||||
responses.add(callback_message);
|
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) => {
|
Widget::DropdownInput(dropdown_input) => {
|
||||||
let callback_message = match action {
|
let callback_message = match action {
|
||||||
WidgetValueAction::Commit => {
|
WidgetValueAction::Commit => {
|
||||||
|
|||||||
@@ -428,7 +428,6 @@ impl LayoutGroup {
|
|||||||
let val = match &mut *widget.widget {
|
let val = match &mut *widget.widget {
|
||||||
Widget::CheckboxInput(x) => &mut x.tooltip_description,
|
Widget::CheckboxInput(x) => &mut x.tooltip_description,
|
||||||
Widget::ColorInput(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::DropdownInput(x) => &mut x.tooltip_description,
|
||||||
Widget::IconButton(x) => &mut x.tooltip_description,
|
Widget::IconButton(x) => &mut x.tooltip_description,
|
||||||
Widget::IconLabel(x) => &mut x.tooltip_description,
|
Widget::IconLabel(x) => &mut x.tooltip_description,
|
||||||
@@ -769,7 +768,6 @@ pub enum Widget {
|
|||||||
ColorComparisonInput(ColorComparisonInput),
|
ColorComparisonInput(ColorComparisonInput),
|
||||||
ColorInput(ColorInput),
|
ColorInput(ColorInput),
|
||||||
ColorPresetsInput(ColorPresetsInput),
|
ColorPresetsInput(ColorPresetsInput),
|
||||||
CurveInput(CurveInput),
|
|
||||||
DropdownInput(DropdownInput),
|
DropdownInput(DropdownInput),
|
||||||
IconButton(IconButton),
|
IconButton(IconButton),
|
||||||
IconLabel(IconLabel),
|
IconLabel(IconLabel),
|
||||||
@@ -838,7 +836,6 @@ impl DiffUpdate {
|
|||||||
Widget::ShortcutLabel(widget) => widget.shortcut.as_mut(),
|
Widget::ShortcutLabel(widget) => widget.shortcut.as_mut(),
|
||||||
Widget::IconLabel(_)
|
Widget::IconLabel(_)
|
||||||
| Widget::ImageLabel(_)
|
| Widget::ImageLabel(_)
|
||||||
| Widget::CurveInput(_)
|
|
||||||
| Widget::NodeCatalog(_)
|
| Widget::NodeCatalog(_)
|
||||||
| Widget::ReferencePointInput(_)
|
| Widget::ReferencePointInput(_)
|
||||||
| Widget::RadioInput(_)
|
| 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 crate::messages::portfolio::document::node_graph::document_node_definitions::DefinitionIdentifier;
|
||||||
use derivative::*;
|
use derivative::*;
|
||||||
use graphene_std::Color;
|
use graphene_std::Color;
|
||||||
use graphene_std::raster::curve::Curve;
|
|
||||||
use graphene_std::transform::ReferencePoint;
|
use graphene_std::transform::ReferencePoint;
|
||||||
use graphene_std::vector::style::{FillChoice, GradientStops};
|
use graphene_std::vector::style::{FillChoice, GradientStops};
|
||||||
use graphite_proc_macros::WidgetBuilder;
|
use graphite_proc_macros::WidgetBuilder;
|
||||||
@@ -420,30 +419,30 @@ pub struct TextInput {
|
|||||||
pub on_commit: WidgetCallback<()>,
|
pub on_commit: WidgetCallback<()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
// #[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||||
#[derive(Clone, serde::Serialize, serde::Deserialize, Derivative, WidgetBuilder)]
|
// #[derive(Clone, serde::Serialize, serde::Deserialize, Derivative, WidgetBuilder)]
|
||||||
#[derivative(Debug, PartialEq, Default)]
|
// #[derivative(Debug, PartialEq, Default)]
|
||||||
pub struct CurveInput {
|
// pub struct CurveInput {
|
||||||
// Content
|
// // Content
|
||||||
#[widget_builder(constructor)]
|
// #[widget_builder(constructor)]
|
||||||
pub value: Curve,
|
// pub value: Curve,
|
||||||
|
|
||||||
// Tooltips
|
// // Tooltips
|
||||||
#[serde(rename = "tooltipLabel")]
|
// #[serde(rename = "tooltipLabel")]
|
||||||
pub tooltip_label: String,
|
// pub tooltip_label: String,
|
||||||
#[serde(rename = "tooltipDescription")]
|
// #[serde(rename = "tooltipDescription")]
|
||||||
pub tooltip_description: String,
|
// pub tooltip_description: String,
|
||||||
#[serde(rename = "tooltipShortcut")]
|
// #[serde(rename = "tooltipShortcut")]
|
||||||
pub tooltip_shortcut: Option<ActionShortcut>,
|
// pub tooltip_shortcut: Option<ActionShortcut>,
|
||||||
|
|
||||||
// Callbacks
|
// // Callbacks
|
||||||
#[serde(skip)]
|
// #[serde(skip)]
|
||||||
#[derivative(Debug = "ignore", PartialEq = "ignore")]
|
// #[derivative(Debug = "ignore", PartialEq = "ignore")]
|
||||||
pub on_update: WidgetCallback<CurveInput>,
|
// pub on_update: WidgetCallback<CurveInput>,
|
||||||
#[serde(skip)]
|
// #[serde(skip)]
|
||||||
#[derivative(Debug = "ignore", PartialEq = "ignore")]
|
// #[derivative(Debug = "ignore", PartialEq = "ignore")]
|
||||||
pub on_commit: WidgetCallback<()>,
|
// pub on_commit: WidgetCallback<()>,
|
||||||
}
|
// }
|
||||||
|
|
||||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||||
#[derive(Clone, Default, Derivative, serde::Serialize, serde::Deserialize, WidgetBuilder)]
|
#[derive(Clone, Default, Derivative, serde::Serialize, serde::Deserialize, WidgetBuilder)]
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ use graphene_std::ATTR_TRANSFORM;
|
|||||||
use graphene_std::NodeInputDecleration;
|
use graphene_std::NodeInputDecleration;
|
||||||
use graphene_std::animation::RealTimeMode;
|
use graphene_std::animation::RealTimeMode;
|
||||||
use graphene_std::extract_xy::XY;
|
use graphene_std::extract_xy::XY;
|
||||||
use graphene_std::raster::curve::Curve;
|
|
||||||
use graphene_std::raster::{
|
use graphene_std::raster::{
|
||||||
BlendMode, CellularDistanceFunction, CellularReturnType, Color, DomainWarpType, FractalType, LuminanceCalculation, NoiseType, RedGreenBlue, RedGreenBlueAlpha, RelativeAbsolute,
|
BlendMode, CellularDistanceFunction, CellularReturnType, Color, DomainWarpType, FractalType, LuminanceCalculation, NoiseType, RedGreenBlue, RedGreenBlueAlpha, RelativeAbsolute,
|
||||||
SelectiveColorChoice,
|
SelectiveColorChoice,
|
||||||
@@ -223,7 +222,6 @@ pub(crate) fn property_from_type(
|
|||||||
// STRUCT TYPES
|
// STRUCT TYPES
|
||||||
// ============
|
// ============
|
||||||
Some(x) if x == TypeId::of::<Font>() => font_widget(default_info),
|
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::<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::<Box<VectorModification>>() => vector_modification_widget(default_info).into(),
|
||||||
Some(x) if x == TypeId::of::<Image<Color>>() => image_data_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()
|
font_widgets.into_iter().chain(style_widgets.unwrap_or_default()).collect::<Vec<_>>().into()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn curve_widget(parameter_widgets_info: ParameterWidgetsInfo) -> LayoutGroup {
|
// pub fn curve_widget(parameter_widgets_info: ParameterWidgetsInfo) -> LayoutGroup {
|
||||||
let ParameterWidgetsInfo { document_node, node_id, index, .. } = parameter_widgets_info;
|
// 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(document_node) = document_node else { return LayoutGroup::default() };
|
||||||
let Some(input) = document_node.inputs.get(index) else {
|
// 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.");
|
// log::warn!("A widget failed to be built because its node's input index is invalid.");
|
||||||
return LayoutGroup::row(vec![]);
|
// return LayoutGroup::row(vec![]);
|
||||||
};
|
// };
|
||||||
if let Some(TaggedValue::Curve(curve)) = &input.as_non_exposed_value() {
|
// if let Some(TaggedValue::Curve(curve)) = &input.as_non_exposed_value() {
|
||||||
widgets.extend_from_slice(&[
|
// widgets.extend_from_slice(&[
|
||||||
Separator::new(SeparatorStyle::Unrelated).widget_instance(),
|
// Separator::new(SeparatorStyle::Unrelated).widget_instance(),
|
||||||
CurveInput::new(curve.clone())
|
// CurveInput::new(curve.clone())
|
||||||
.on_update(update_value(|x: &CurveInput| TaggedValue::Curve(x.value.clone()), node_id, index))
|
// .on_update(update_value(|x: &CurveInput| TaggedValue::Curve(x.value.clone()), node_id, index))
|
||||||
.on_commit(commit_value)
|
// .on_commit(commit_value)
|
||||||
.widget_instance(),
|
// .widget_instance(),
|
||||||
])
|
// ])
|
||||||
}
|
// }
|
||||||
LayoutGroup::row(widgets)
|
// LayoutGroup::row(widgets)
|
||||||
}
|
// }
|
||||||
|
|
||||||
pub fn get_document_node<'a>(node_id: NodeId, context: &'a NodePropertiesContext<'a>) -> Result<&'a DocumentNode, String> {
|
pub fn get_document_node<'a>(node_id: NodeId, context: &'a NodePropertiesContext<'a>) -> Result<&'a DocumentNode, String> {
|
||||||
let network = context
|
let network = context
|
||||||
|
|||||||
@@ -520,10 +520,6 @@ const NODE_REPLACEMENTS: &[NodeReplacement<'static>] = &[
|
|||||||
node: graphene_std::raster_nodes::adjustments::gamma_correction::IDENTIFIER,
|
node: graphene_std::raster_nodes::adjustments::gamma_correction::IDENTIFIER,
|
||||||
aliases: &["graphene_raster_nodes::adjustments::GammaCorrectionNode", "graphene_core::raster::adjustments::GammaCorrectionNode"],
|
aliases: &["graphene_raster_nodes::adjustments::GammaCorrectionNode", "graphene_core::raster::adjustments::GammaCorrectionNode"],
|
||||||
},
|
},
|
||||||
NodeReplacement {
|
|
||||||
node: graphene_std::raster_nodes::generate_curves::generate_curves::IDENTIFIER,
|
|
||||||
aliases: &["graphene_raster_nodes::generate_curves::GenerateCurvesNode", "graphene_core::raster::adjustments::GenerateCurvesNode"],
|
|
||||||
},
|
|
||||||
NodeReplacement {
|
NodeReplacement {
|
||||||
node: graphene_std::raster_nodes::gradient_map::gradient_map::IDENTIFIER,
|
node: graphene_std::raster_nodes::gradient_map::gradient_map::IDENTIFIER,
|
||||||
aliases: &[
|
aliases: &[
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
import ColorComparisonInput from "/src/components/widgets/inputs/ColorComparisonInput.svelte";
|
import ColorComparisonInput from "/src/components/widgets/inputs/ColorComparisonInput.svelte";
|
||||||
import ColorInput from "/src/components/widgets/inputs/ColorInput.svelte";
|
import ColorInput from "/src/components/widgets/inputs/ColorInput.svelte";
|
||||||
import ColorPresetsInput from "/src/components/widgets/inputs/ColorPresetsInput.svelte";
|
import ColorPresetsInput from "/src/components/widgets/inputs/ColorPresetsInput.svelte";
|
||||||
import CurveInput from "/src/components/widgets/inputs/CurveInput.svelte";
|
|
||||||
import DropdownInput from "/src/components/widgets/inputs/DropdownInput.svelte";
|
import DropdownInput from "/src/components/widgets/inputs/DropdownInput.svelte";
|
||||||
import NumberInput from "/src/components/widgets/inputs/NumberInput.svelte";
|
import NumberInput from "/src/components/widgets/inputs/NumberInput.svelte";
|
||||||
import RadioInput from "/src/components/widgets/inputs/RadioInput.svelte";
|
import RadioInput from "/src/components/widgets/inputs/RadioInput.svelte";
|
||||||
@@ -153,16 +152,6 @@
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
CurveInput: {
|
|
||||||
// TODO: CurvesInput is currently unused
|
|
||||||
component: CurveInput,
|
|
||||||
getProps: (props, index) => ({
|
|
||||||
...props,
|
|
||||||
$$events: {
|
|
||||||
value: (e: CustomEvent) => widgetValueCommitAndUpdate(index, e.detail, false),
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
DropdownInput: {
|
DropdownInput: {
|
||||||
component: DropdownInput,
|
component: DropdownInput,
|
||||||
getProps: (props, index) => ({
|
getProps: (props, index) => ({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<script lang="ts">
|
<!-- <script lang="ts">
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher } from "svelte";
|
||||||
import LayoutRow from "/src/components/layout/LayoutRow.svelte";
|
import LayoutRow from "/src/components/layout/LayoutRow.svelte";
|
||||||
import type { Curve, CurveManipulatorGroup, ActionShortcut } from "/wrapper/pkg/graphite_wasm_wrapper";
|
import type { Curve, CurveManipulatorGroup, ActionShortcut } from "/wrapper/pkg/graphite_wasm_wrapper";
|
||||||
@@ -256,4 +256,4 @@
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style> -->
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ use graphic_types::raster_types::{CPU, Image, Raster};
|
|||||||
use graphic_types::vector_types::vector::style::{Fill, Gradient, GradientStops, Stroke};
|
use graphic_types::vector_types::vector::style::{Fill, Gradient, GradientStops, Stroke};
|
||||||
use graphic_types::vector_types::vector::{self, ReferencePoint};
|
use graphic_types::vector_types::vector::{self, ReferencePoint};
|
||||||
use graphic_types::{Artboard, Graphic, Vector};
|
use graphic_types::{Artboard, Graphic, Vector};
|
||||||
use raster_nodes::curve::Curve;
|
|
||||||
use rendering::RenderMetadata;
|
use rendering::RenderMetadata;
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
@@ -212,7 +211,6 @@ tagged_value! {
|
|||||||
Font(Font),
|
Font(Font),
|
||||||
DocumentNode(DocumentNode),
|
DocumentNode(DocumentNode),
|
||||||
ContextFeatures(ContextFeatures),
|
ContextFeatures(ContextFeatures),
|
||||||
Curve(Curve),
|
|
||||||
Footprint(Footprint),
|
Footprint(Footprint),
|
||||||
VectorModification(Box<VectorModification>),
|
VectorModification(Box<VectorModification>),
|
||||||
ImageData(Image<Color>),
|
ImageData(Image<Color>),
|
||||||
|
|||||||
@@ -158,7 +158,6 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
|
|||||||
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => graphene_std::text::Font]),
|
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => graphene_std::text::Font]),
|
||||||
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => Table<BrushStroke>]),
|
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => Table<BrushStroke>]),
|
||||||
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => DocumentNode]),
|
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => DocumentNode]),
|
||||||
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => graphene_std::raster::curve::Curve]),
|
|
||||||
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => graphene_std::transform::Footprint]),
|
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => graphene_std::transform::Footprint]),
|
||||||
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => graphene_std::blending::BlendMode]),
|
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => graphene_std::blending::BlendMode]),
|
||||||
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => graphene_std::raster::adjustments::LuminanceCalculation]),
|
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => graphene_std::raster::adjustments::LuminanceCalculation]),
|
||||||
@@ -246,7 +245,6 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
|
|||||||
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => Table<BrushStroke>]),
|
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => Table<BrushStroke>]),
|
||||||
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => DocumentNode]),
|
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => DocumentNode]),
|
||||||
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => graphene_std::ContextFeatures]),
|
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => graphene_std::ContextFeatures]),
|
||||||
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => graphene_std::raster::curve::Curve]),
|
|
||||||
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => graphene_std::transform::Footprint]),
|
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => graphene_std::transform::Footprint]),
|
||||||
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => Box<graphene_std::vector::VectorModification>]),
|
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => Box<graphene_std::vector::VectorModification>]),
|
||||||
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => graphene_std::vector::style::Fill]),
|
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => graphene_std::vector::style::Fill]),
|
||||||
|
|||||||
@@ -10,15 +10,11 @@ pub mod fullscreen_vertex;
|
|||||||
#[cfg(feature = "shader-nodes")]
|
#[cfg(feature = "shader-nodes")]
|
||||||
pub use raster_nodes_shaders::WGSL_SHADER;
|
pub use raster_nodes_shaders::WGSL_SHADER;
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
pub mod curve;
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
pub mod dehaze;
|
pub mod dehaze;
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
pub mod filter;
|
pub mod filter;
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
pub mod generate_curves;
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
pub mod gradient_map;
|
pub mod gradient_map;
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
pub mod image_color_palette;
|
pub mod image_color_palette;
|
||||||
|
|||||||
Reference in New Issue
Block a user