Skip to content

Commit

Permalink
fix save graph class datum node position on leave
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmtimbo committed Dec 7, 2024
1 parent fa58396 commit 4210e13
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/system/platform/component/app/Editor/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31060,18 +31060,17 @@ export class Editor_ extends Element<HTMLDivElement, Props_> {
this.$system.classes
)

unitBundle = unitBundleSpec(
unitBundle.unit,
weakMerge(unitBundle.specs, specs)
)
const specs_ = weakMerge(specs, unitBundle.specs)

unitBundle = unitBundleSpec(unitBundle.unit, specs_)

const spec = getSpec(unitBundle.unit.id) as GraphSpec

if (isBaseSpec(spec)) {
return
}

const bundle = bundleSpec(spec, weakMerge(unitBundle.specs, specs))
const bundle = bundleSpec(spec, specs_)

const graph = start(this._system, bundle, true)

Expand Down Expand Up @@ -31147,7 +31146,10 @@ export class Editor_ extends Element<HTMLDivElement, Props_> {

const modified_value = `$${stringify(modified_bundle)}`

const specs = weakMerge(this.$system.specs, unitBundle.specs ?? {})
const specs = weakMerge(
this.$system.specs,
modified_bundle.specs ?? {}
)

const id = modified_bundle.unit.id

Expand All @@ -31157,12 +31159,11 @@ export class Editor_ extends Element<HTMLDivElement, Props_> {

this._set_spec_node_positions(spec, editor, node_positions)

setSpec(spec.id, spec)

const class_datum_comp = this._datum[datum_node_id] as ClassDatum

class_datum_comp.setProp(
'specs',
weakMerge(specs, modified_bundle.specs)
)
class_datum_comp.setProp('specs', specs)

if (pin_node_id) {
this._set_unit_pin_data(pin_node_id, modified_value)
Expand Down Expand Up @@ -53536,10 +53537,6 @@ export class Editor_ extends Element<HTMLDivElement, Props_> {
editor: Editor_,
node_positions: Dict<Position>
) => {
if (!spec) {
return
}

for (const node_id in node_positions) {
const node_position = node_positions[node_id]

Expand Down

0 comments on commit 4210e13

Please sign in to comment.