/*
* Orvanta API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 6.5.0
* Contact: contact@orvanta.cloud
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// FlowNoteCanvasPosition : Orientation-aware position for the DAG canvas (#1727 part 2), in that canvas's own auto-laid-out coordinate space for the given orientation — the exact xyflow node position at the moment the note was last dragged (see `dagGraph.ts`'s `placeFreeNotes`, which reads it back as-is), NOT a position relative to the flow's bounding box. It stays sensibly placed across an edit that doesn't change the flow's own layout, but a structural change that shifts everything (a step inserted upstream, an orientation-independent reflow) can leave it stale, same as any other absolute coordinate would; unlike `position` (authored against the legacy canvas's own absolute layout, which has no relationship to this canvas's auto-computed one at all — a stronger mismatch than a merely-stale one). Two independent slots because LR and TD are different layouts with different coordinate spaces — a position that made sense in one orientation can fall outside the flow, or on top of a node, in the other. Both optional and independent: a note dragged only in LR has no `td` entry, and auto-places (the existing strip layout) for TD until the user drags it there too.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FlowNoteCanvasPosition {
#[serde(rename = "lr", skip_serializing_if = "Option::is_none")]
pub lr: Option<Box<models::FlowNoteCanvasPositionLr>>,
#[serde(rename = "td", skip_serializing_if = "Option::is_none")]
pub td: Option<Box<models::FlowNoteCanvasPositionTd>>,
}
impl FlowNoteCanvasPosition {
/// Orientation-aware position for the DAG canvas (#1727 part 2), in that canvas's own auto-laid-out coordinate space for the given orientation — the exact xyflow node position at the moment the note was last dragged (see `dagGraph.ts`'s `placeFreeNotes`, which reads it back as-is), NOT a position relative to the flow's bounding box. It stays sensibly placed across an edit that doesn't change the flow's own layout, but a structural change that shifts everything (a step inserted upstream, an orientation-independent reflow) can leave it stale, same as any other absolute coordinate would; unlike `position` (authored against the legacy canvas's own absolute layout, which has no relationship to this canvas's auto-computed one at all — a stronger mismatch than a merely-stale one). Two independent slots because LR and TD are different layouts with different coordinate spaces — a position that made sense in one orientation can fall outside the flow, or on top of a node, in the other. Both optional and independent: a note dragged only in LR has no `td` entry, and auto-places (the existing strip layout) for TD until the user drags it there too.
pub fn new() -> FlowNoteCanvasPosition {
FlowNoteCanvasPosition {
lr: None,
td: None,
}
}
}