From 020dec64cc56f007392c86fef001b550c5526ce9 Mon Sep 17 00:00:00 2001 From: John Lindal Date: Tue, 2 Jan 2024 22:56:46 -0800 Subject: [PATCH] jx_layout_editor: apply grid spacing to window resize --- todo-jxlayout | 4 ++-- tools/jx_layout_editor/code/LayoutDocument.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/todo-jxlayout b/todo-jxlayout index ad2ac632a..d04a156a6 100644 --- a/todo-jxlayout +++ b/todo-jxlayout @@ -2,11 +2,11 @@ resize like window - any edge or corner shift key to turn off grid -arrange menu: icons + meta-arrow keys shift arrow keys - align to grid - shift key to turn off + shift key to turn off grid accumulate into single undo ----- diff --git a/tools/jx_layout_editor/code/LayoutDocument.cpp b/tools/jx_layout_editor/code/LayoutDocument.cpp index 222ae883e..961b92e03 100644 --- a/tools/jx_layout_editor/code/LayoutDocument.cpp +++ b/tools/jx_layout_editor/code/LayoutDocument.cpp @@ -204,6 +204,8 @@ LayoutDocument::BuildWindow() 0,0, 100,100); itsLayout->FitToEnclosure(); + GetWindow()->SetStepSize(itsLayout->GetGridSpacing(), itsLayout->GetGridSpacing()); + // menus itsFileMenu = itsMenuBar->PrependTextMenu(JGetString("MenuTitle::LayoutDocument_File")); @@ -636,10 +638,12 @@ LayoutDocument::HandleGridMenu if (index == kGrid5Cmd) { itsLayout->SetGridSpacing(5); + GetWindow()->SetStepSize(5,5); } if (index == kGrid10Cmd) { itsLayout->SetGridSpacing(10); + GetWindow()->SetStepSize(10,10); } }