[SOLVED] Application capable of measuring angles and distances.

Mark Read

Well-Known Member
Licensed User
Longtime User
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:

klaus

Expert
Licensed User
Longtime User
I have already changed the Draw method in my current version and the resizing works now.
The clipping path is used to limit the drawing on the diagram.
Otherwise, when you zoom, parts would be drawn on the left and the bottom of the scale.
The latest version has not yet been published.
I am going to remove the Scale mode and move the graphic with the right mouse button for B4J and with gestures on B4A.
 
Top