B4J Question B4XCanvas - InitializeArc looks different than in B4A

Alexander Stolte

Expert
Licensed User
Longtime User
Hey,
why it look in B4J so?:
1589902873778.png

and on B4A only the right outer line is to watch?
B4X:
Dim tmp_bp As B4XPath
    tmp_bp.InitializeArc(xcv_main.TargetRect.CenterX,xcv_main.TargetRect.CenterY,Height/2,10,20)   
    xcv_main.DrawPath(tmp_bp,xui.Color_Blue,False,5dip)
 

Star-Dust

Expert
Licensed User
Longtime User
Hey,
why it look in B4J so?:
View attachment 94362
and on B4A only the right outer line is to watch?
B4X:
Dim tmp_bp As B4XPath
    tmp_bp.InitializeArc(xcv_main.TargetRect.CenterX,xcv_main.TargetRect.CenterY,Height/2,10,20) 
    xcv_main.DrawPath(tmp_bp,xui.Color_Blue,False,5dip)
Behaviors are different. In B4A the path is closed, if you don't want to close it you have to use the lines not the path.

In B4J the path is not closed, If you want to close you must bring an end point coinciding with the starting point
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Something like that

B4X:
    Dim X as Float ' Center
    Dim Y as Float ' Center
    Dim LastX as float = 0
    Dim LastY as Float = 0

For i=StartDegree To EndDegree
        Dim x1 As Float = x + ray * CosD(i/2)
        Dim Y1 As Float = y + ray * SinD(i/2)
        if LastX<>0 and LastY<>0 Then DravLine(LastX,LastY,X1,Y1)
        
        LastX=X1
        LastY=Y1
    Next
 
Upvote 0
Top