LM_Graphics:BeginDraw()

Version added: before 9.5

Call this function before starting any drawing commands

Return type : none

This function may be called before any other commands on an LM_Graphics object in order to reset it. For example, if it is called after ApplyMatrix() it will reset the transforms as though the matrix had not been applied. Often it is not necessary to call this. For example to draw a line between two points p2 and p3:

--
local g = view:Graphics()
local matrix = LM.Matrix:new_local()
moho.drawingLayer:GetFullTransform(moho.layerFrame, matrix, moho.document)
g:Push()
g:ApplyMatrix(matrix)
g:SetColor(MOHO.MohoGlobals.SelCol)
g:DrawLine(p2.x, p2.y, p3.x, p3.y)
g:Pop()