Skip to content

Commit 59daca2

Browse files
committed
Create the canvas as large as it can be to avoid issues with output when zoomed source image exceeds visible canvas area width
1 parent 92ee08d commit 59daca2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Types/UserInterface.bmx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ Type UserInterface
166166
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
167167

168168
Method InitializeCanvasGraphics()
169-
m_CanvasGraphics = CreateCanvas(m_CanvasGraphicsAnchor[0], m_CanvasGraphicsAnchor[1], GadgetWidth(m_MainWindow) - m_CanvasGraphicsAnchor[0], GadgetHeight(m_MainWindow) - m_CanvasGraphicsAnchor[1], m_MainWindow)
169+
'm_CanvasGraphics = CreateCanvas(m_CanvasGraphicsAnchor[0], m_CanvasGraphicsAnchor[1], GadgetWidth(m_MainWindow) - m_CanvasGraphicsAnchor[0], GadgetHeight(m_MainWindow) - m_CanvasGraphicsAnchor[1], m_MainWindow)
170+
'Create the canvas as large as it can be to avoid bad output when source image is zoomed beyond canvas width. Everything grabbed outside the visible area is null and the output limbs are back squares.
171+
m_CanvasGraphics = CreateCanvas(m_CanvasGraphicsAnchor[0], m_CanvasGraphicsAnchor[1], GetMaxWorkspaceWidth(), DesktopHeight(), m_MainWindow)
172+
170173
SetGadgetLayout(m_CanvasGraphics, m_CanvasGraphicsAnchor[0], m_CanvasGraphicsSize[0], m_CanvasGraphicsAnchor[1], m_CanvasGraphicsSize[1])
171174
SetGraphicsDriver(GLMax2DDriver())
172175
SetGraphics(CanvasGraphics(m_CanvasGraphics))
@@ -180,8 +183,8 @@ Type UserInterface
180183
MoveGadget(m_LogoImagePanel, 0, GadgetHeight(m_MainWindow) - m_LogoImagePanelSize[1])
181184

182185
'Have to recreate the canvas because the backbuffer doesn't resize with the window.
183-
FreeGadget(m_CanvasGraphics)
184-
InitializeCanvasGraphics()
186+
'FreeGadget(m_CanvasGraphics)
187+
'InitializeCanvasGraphics()
185188
EndMethod
186189

187190
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)