feat(svg-editor): implement interactive SVG node editor with parsing and editing capabilities
feat(debug-logger): add DebugSignalLogger plugin for event logging and inspection feat(plugins): introduce built-in plugins module and integrate debug logger feat(plugin-integration): create integration layer for mapping Iced Messages to CoreEvents feat(plugin-registry): establish PluginRegistry for managing plugins and event dispatching
This commit is contained in:
@@ -438,6 +438,7 @@ pub fn create_vector_shape(
|
||||
) -> VectorShape {
|
||||
let svg = hcie_vector::svg_templates::create_svg(kind, params);
|
||||
VectorShape::SvgShape {
|
||||
name: String::new(),
|
||||
x1,
|
||||
y1,
|
||||
x2,
|
||||
@@ -467,6 +468,7 @@ pub fn create_vector_shape_from_svg(
|
||||
y2: f32,
|
||||
) -> VectorShape {
|
||||
VectorShape::SvgShape {
|
||||
name: String::new(),
|
||||
x1,
|
||||
y1,
|
||||
x2,
|
||||
@@ -1630,6 +1632,20 @@ impl Engine {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn reorder_vector_shape(&mut self, layer_id: u64, from_idx: usize, to_idx: usize) {
|
||||
if let Some(layer) = self.document.get_layer_by_id_mut(layer_id) {
|
||||
if let LayerData::Vector { ref mut shapes } = layer.data {
|
||||
if from_idx < shapes.len() && to_idx < shapes.len() {
|
||||
let shape = shapes.remove(from_idx);
|
||||
shapes.insert(to_idx, shape);
|
||||
layer.dirty = true;
|
||||
self.document.composite_dirty = true;
|
||||
self.document.modified = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn delete_vector_shape(&mut self, layer_id: u64, shape_idx: usize) {
|
||||
if let Some(layer) = self.document.get_layer_by_id_mut(layer_id) {
|
||||
if let LayerData::Vector { ref mut shapes } = layer.data {
|
||||
@@ -3086,6 +3102,7 @@ impl Engine {
|
||||
.collect();
|
||||
if !path_pts.is_empty() {
|
||||
let shape = hcie_protocol::VectorShape::FreePath {
|
||||
name: String::new(),
|
||||
pts: path_pts,
|
||||
closed,
|
||||
stroke: stroke_width,
|
||||
@@ -3192,6 +3209,7 @@ impl Engine {
|
||||
let fc = parse_hex_color(fill_hex);
|
||||
let sc = parse_hex_color(stroke_hex);
|
||||
let shape = VectorShape::Circle {
|
||||
name: String::new(),
|
||||
x1: cx - rx,
|
||||
y1: cy - ry,
|
||||
x2: cx + rx,
|
||||
@@ -3218,6 +3236,7 @@ impl Engine {
|
||||
let fc = parse_hex_color(fill_hex);
|
||||
let sc = parse_hex_color(stroke_hex);
|
||||
let shape = VectorShape::Rect {
|
||||
name: String::new(),
|
||||
x1,
|
||||
y1,
|
||||
x2,
|
||||
@@ -3366,6 +3385,7 @@ impl Engine {
|
||||
[0u8; 4]
|
||||
};
|
||||
let shape = VectorShape::FreePath {
|
||||
name: String::new(),
|
||||
pts: px_pts,
|
||||
closed: comp.closed,
|
||||
stroke: stroke_width,
|
||||
|
||||
@@ -109,6 +109,7 @@ fn red_rect_over_green_rect() {
|
||||
fn vector_rect_golden() {
|
||||
let mut engine = Engine::new(16, 16);
|
||||
let shape = VectorShape::Rect {
|
||||
name: String::new(),
|
||||
x1: 0.0,
|
||||
y1: 0.0,
|
||||
x2: 16.0,
|
||||
@@ -222,6 +223,7 @@ fn vector_fill_toggle_and_delete() {
|
||||
|
||||
// Create a rect with fill=false
|
||||
let shape = VectorShape::Rect {
|
||||
name: String::new(),
|
||||
x1: 2.0,
|
||||
y1: 2.0,
|
||||
x2: 14.0,
|
||||
|
||||
Reference in New Issue
Block a user