mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 11:08:11 +08:00
Code cleanup and refactoring to enhance consistency (#1695)
- Move message handler payload data into structs
- Organize the file structure used by `editor/src/messages/portfolio/document` `/node_graph` and `/graph_operation`
- Make derive attributes use `serde::Serialize, serde::Deserialize` consistently instead of `use serde::{Deserialize, Serialize};` imports
- Various other code cleanup and refactoring
This commit is contained in:
@@ -4,10 +4,9 @@ use crate::utils::parse_cap;
|
||||
use bezier_rs::{ArcStrategy, ArcsOptions, Bezier, Identifier, TValue, TValueType};
|
||||
|
||||
use glam::DVec2;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
struct CircleSector {
|
||||
center: DVec2,
|
||||
radius: f64,
|
||||
@@ -32,7 +31,7 @@ const SCALE_UNIT_VECTOR_FACTOR: f64 = 50.;
|
||||
pub struct WasmBezier(Bezier);
|
||||
|
||||
/// Serialize some data and then convert it to a JsValue.
|
||||
fn to_js_value<T: Serialize>(data: T) -> JsValue {
|
||||
fn to_js_value<T: serde::Serialize>(data: T) -> JsValue {
|
||||
serde_wasm_bindgen::to_value(&serde_json::to_string(&data).unwrap()).unwrap()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user