fix: PropertyPanel の justifyContent/alignItems 等 flex プロパティが反映されない + テスト追加#54
Merged
fix: PropertyPanel の justifyContent/alignItems 等 flex プロパティが反映されない + テスト追加#54
Conversation
## 症状 PropertyPanel の Auto Layout セクションから justifyContent / alignItems / gap / padding / layout を変更しても canvas に反映されない。opacity など レイアウト非依存のプロパティは動作するのに、レイアウト関係だけ効かない。 ## 原因 CanvasContent は state.doc (ドキュメント読み込み時に layoutDocument で 計算済みのもの) を描画に使っていた。編集時 state.doc / state.rawDoc は 直接書き換えられるが、flex レイアウトは再計算されていなかった。そのため fill / opacity / rotation のように ノード自身のプロパティで決まるものは 反映されるが、justifyContent のような子の配置を決めるプロパティは 効かなかった。 ## 修正 CanvasContent を state.rawDoc から毎レンダリングで resolveRefs → substituteVariables → layoutDocument を再計算する形に変更。state.rawDoc は editor が直接更新しているので flex プロパティ変更も即時反映される。 ## 追加テスト (依頼の最近実装分) - tests/booleanOps.test.ts: nodeToPolygon / polygonToPathD / booleanOperation 4 op + エッジケース (13 件) - tests/flatten.test.ts: flattenToPath / outlineStroke align 別 + エッジ (9 件) - tests/maskedChildren.test.ts: splitByMasks のセグメント分割 (6 件) - MaskedChildren から splitByMasks を export - 合計 138 → 144 tests (+28 from このセッション) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
症状
PropertyPanel の Auto Layout セクションから justifyContent / alignItems / gap / padding / layout を変更しても canvas に反映されない。opacity / fill / rotation など単一ノードのプロパティは動作するのに、レイアウト関係だけ効かない。
原因
CanvasContentはstate.doc(ドキュメント読み込み時にlayoutDocumentで計算済みのもの)を描画に使っていた。編集時state.doc/state.rawDocは直接書き換えられるが、flex レイアウトは再計算されていなかった。そのため fill / opacity / rotation のように ノード自身のプロパティで決まるもの は反映されるが、justifyContent のような 子の配置を決めるプロパティ は効かなかった。
修正
CanvasContentをstate.rawDocから毎レンダリングでを再計算する形に変更。
state.rawDocは editor が直接更新しているので flex プロパティ変更も即時反映される。追加テスト(依頼された「最近実装した所から」)
tests/booleanOps.test.ts: nodeToPolygon / polygonToPathD / booleanOperation 4 op + エッジケース (13 件)tests/flatten.test.ts: flattenToPath / outlineStroke align 別 + エッジ (9 件)tests/maskedChildren.test.ts: splitByMasks のセグメント分割 (6 件)MaskedChildrenからsplitByMasksを exportTest plan
🤖 Generated with Claude Code