I am porting an application from B4A to B4J which uses a number of CustomView XUI objects for the main display interfaces.
While most things work OK I have a problem with the way B4J renders a path vs B4A method.
In B4A I use a path to draw a rotated series of line segments.
It is possible for these line segments of the path to all fall in a straight line.
In B4A the line is still rendered correctly when the lines are straight.
By way of demonstration this much simplified code renders a straight line in B4A:
When dlcy = drcy a line is drawn.
In B4J the same code draws the path when the lines are not in a single line.
BUT when they all fall in a line then no path is actually drawn.
In order to get B4J to render the path it seems I need to do the following:
When dlcy = drcy NO line is drawn unless I offset the path as above and by the stroke width as a minimum.
I understand there are differences between the position of the drawing line between B4A and B4J but I cannot see why the B4J line does not show when the points make a path that draw over itself. The same thing happens if you use filled as well as outline.
Does anyone know if this is just a javafx standard or is there a setting or something I have missed?
It appears as if the path is rendered but the return stroke erases the original stroke. Could this be an XOR operation or something? Antialiasing?
I cannot see why it would be logical for the path not to be drawn even if it completely overlaps itself.
The CustomViews I have written contain a lot of paths to be drawn so to go through and specifically extract straight lines and render (and rotate) these as exceptions is not viable as its already rendering much more slowly than on Android.
While most things work OK I have a problem with the way B4J renders a path vs B4A method.
In B4A I use a path to draw a rotated series of line segments.
It is possible for these line segments of the path to all fall in a straight line.
In B4A the line is still rendered correctly when the lines are straight.
By way of demonstration this much simplified code renders a straight line in B4A:
B4A line using path:
Dim sl As B4XPath
sl.Initialize(cl-100dip,drcy)
sl.LineTo(cl+0dip,dlcy)
sl.LineTo(cl+100dip,dlcy)
sl.LineTo(cl-100dip,drcy)
cvs.Drawpathrotated(sl,xui.Color_ARGB(255,180,180,180), False,2,rot,cx,cy)
In B4J the same code draws the path when the lines are not in a single line.
BUT when they all fall in a line then no path is actually drawn.
In order to get B4J to render the path it seems I need to do the following:
B4J version to render path:
Dim sl As B4XPath
sl.Initialize(cl-100dip,drcy)
sl.LineTo(cl+0dip,dlcy)
sl.LineTo(cl+100dip,dlcy+2dip)
sl.LineTo(cl-100dip,drcy+2dip)
cvs.Drawpathrotated(sl,xui.Color_ARGB(255,180,180,180), False,2,rot,cx,cy)
I understand there are differences between the position of the drawing line between B4A and B4J but I cannot see why the B4J line does not show when the points make a path that draw over itself. The same thing happens if you use filled as well as outline.
Does anyone know if this is just a javafx standard or is there a setting or something I have missed?
It appears as if the path is rendered but the return stroke erases the original stroke. Could this be an XOR operation or something? Antialiasing?
I cannot see why it would be logical for the path not to be drawn even if it completely overlaps itself.
The CustomViews I have written contain a lot of paths to be drawn so to go through and specifically extract straight lines and render (and rotate) these as exceptions is not viable as its already rendering much more slowly than on Android.