Bug? B4J on Raspberry Pi Java 11

labcold

Member
Licensed User
Longtime User
I am trying to port a B4X (actually originally on Android) application to work on Raspberry PI-3. I am using the Liberica JDK 11.0.12+7 B4J 8.90
Many things are working well and the actual code below does render.
Simple Drawing Using B4XCanvas:
Sub Button1_Click
    Dim cvs As B4XCanvas
    cvs.Initialize(Pane1)
    cvs.ClearRect(cvs.TargetRect)
    Dim cl As float = cvs.TargetRect.Left * 1dip
    Dim cr As float = cvs.TargetRect.Right * 1dip
    Dim cx As float = cvs.TargetRect.Width / 2dip
    Dim cy As float = cvs.TargetRect.Height / 2dip
    Dim drcy As float = 10dip
    Dim lh As B4XPath
    lh.Initialize(cl-100dip, drcy)
    lh.LineTo(cr+100dip, drcy)
    lh.LineTo(cr+100dip, drcy * 2)
    lh.LineTo(cl-100dip, drcy * 2)
    cvs.DrawPathrotated(lh,xui.Color_Red,True,1,20,cx,cy)
End Sub

However, if the path is straight along the X axis (i.e. all Y points are the same) then it doesnt draw any line, similarly for vertical lines (i.e. all X points are the same).
I use paths as I want to rotate them when I draw and sometimes those lines will be along the same X or Y axis.
Does this mean I have to use DrawLine and then rotate them about the axis using standard trig functions?

Also when I try to use XUI and B4X canvas I get the following messages:
Waiting for debugger to connect...
Program started.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by anywheresoftware.b4a.objects.B4XCanvas (file:/home/pi/tempjars/AsyncInput1) to field javafx.scene.canvas.GraphicsContext.path
WARNING: Please consider reporting this to the maintainers of anywheresoftware.b4a.objects.B4XCanvas
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

What I am concerned about is the warning - is this going to cause other issues?
I can run on my desktop and dont get any errors but that is using Java 8_231.
Also I note that the straight lines do not render there so do I assume that this is a 'feature' of Java paths on non android targets?
As above the whole application runs perfectly on Android built with the same java and drawing the straight lines - even a path with just two points.
 

labcold

Member
Licensed User
Longtime User
Ok I will, but as the warnings contain the following:
WARNING: Illegal reflective access by anywheresoftware.b4a.objects.B4XCanvas (file:/home/pi/tempjars/AsyncInput1) to field javafx.scene.canvas.GraphicsContext.path
WARNING: Please consider reporting this to the maintainers of anywheresoftware.b4a.objects.B4XCanvas

I assumed that it was a core lib issue not something I programmed in.
 
Top