Skip to content

Commit

Permalink
jx_layout_editor: apply grid spacing to window resize
Browse files Browse the repository at this point in the history
  • Loading branch information
jafl committed Jan 3, 2024
1 parent 27c42cd commit 020dec6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions todo-jxlayout
Original file line number Diff line number Diff line change
Expand Up @@ -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

-----
Expand Down
4 changes: 4 additions & 0 deletions tools/jx_layout_editor/code/LayoutDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 020dec6

Please sign in to comment.