Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
fix: canvas is no longer squised when a panel is opened
Browse files Browse the repository at this point in the history
  • Loading branch information
prescientmoon committed Jun 24, 2020
1 parent 5340e17 commit 8944655
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Component/Editor.purs
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,17 @@ component =
CreateNode name -> do
createNode name
handleAction Rerender
TogglePanel -> modify_ $ over _panelIsOpen not
TogglePanel -> do
modify_ $ over _panelIsOpen not
void $ query (SProxy :: _ "scene") unit $ tell Scene.HandleResize
ChangeTab newTab -> do
oldTab <- gets $ view _currentTab
panelWasOpen <- gets $ view _panelIsOpen
if (oldTab == newTab) then
handleAction TogglePanel
else do
modify_ $ set _currentTab newTab <<< set _panelIsOpen true
void $ query (SProxy :: _ "scene") unit $ tell Scene.HandleResize
CreateFunction name -> do
modify_ $ initializeFunction name
SelectFunction name -> do
Expand Down
4 changes: 4 additions & 0 deletions src/Component/Editor/Scene.purs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type Input

data Query a
= LoadScene GeometryCache a
| HandleResize a
| Rerender a

data Output
Expand Down Expand Up @@ -117,6 +118,9 @@ component =
Rerender a -> do
handleAction Render
pure $ Just a
HandleResize a -> do
handleAction ResizeCanvas
pure $ Just a

-- This only renders the canvas, the rest of the rendering is done via some typescript code
render =
Expand Down

0 comments on commit 8944655

Please sign in to comment.