I have not tested the form resizing.
Changing the Draw function in B4XMainPage shows everything after resize. I am not familiar with the ClipPath function so I do not know what you wanted to do here.
However there are still a few minor problems: In full scrren mode, I cannot move the top of the crane further than the building. Aha, correction, you have limited the crane boom length amongst other things in the CraneObject Initialize class. Probably better to have inputs for these defaults, to make them easier to find. But still great work Klaus.
B4X:
Public Sub Draw
If Mode = "Measure" Then Return
pthScene.Initialize(SceneOriginX, 0)
pthScene.LineTo(cvsGrid.TargetRect.Width, 0)
pthScene.LineTo(cvsGrid.TargetRect.Width, SceneOriginY)
pthScene.LineTo(SceneOriginX, SceneOriginY)
'cvsScene.ClipPath(pthScene) <= Commented out
cvsCursor.ClearRect(cvsScene.TargetRect)
cvsScene.ClearRect(cvsScene.TargetRect)
For o = 0 To ListObjects.Size - 1
Private Obj As ObjectData
Obj = ListObjects.Get(o)
If Obj.ObjectType = "Building" Then
Obj.Item.As(BuildingObject).Draw
End If
Next
For o = 0 To ListObjects.Size - 1
Private Obj As ObjectData
Obj = ListObjects.Get(o)
If Obj.ObjectType = "Load" Then
Obj.Item.As(LoadObject).Draw
End If
Next
For o = 0 To ListObjects.Size - 1
Private Obj As ObjectData
Obj = ListObjects.Get(o)
If Obj.ObjectType = "Crane" Then
Obj.Item.As(CraneObject).Draw
End If
Next
cvsScene.Invalidate
End Sub
Last edited: