-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plotutil 3rd dashed line only partially renders at certain resolutions #231
Comments
The same fault happens when you save to jpg and tiff, but not to svg. I suspect this is a github.com/llgcode/draw2d bug. |
interesting library. I'll see about reproducing specific to draw2d and if it's an issue that can actually be addressed there. Though to some degree, I might expect a drawing library to drop data too small to render in a given frame where as I might expect a plotter to compensate to produce something useful. |
A way to approach this might be to capture what it being drawn with recorder.Canvas and replaying sections of the captured actions to figure out what is going on. I may be able to get to this today. |
I'm certainly in no rush and only discovered today that an increase in On Mon, Nov 23, 2015 at 4:52 PM Dan Kortschak [email protected]
|
Here is a simpler reproducer; I'm not sure the recorder will help here.
If the dash/space length is 2 or 3 you get the effect (2 causes continuous line and 3 causes blank). Above that it is always a continuous line. The point at which break happens is not consistent between the 2 and 3 cases. Interestingly if you have replicas of the lines, they all break at the same part of the curve. The error appears to be in draw2dbase.(*DashVertexConverter).lineTo where alternation between gap and line is calculated, though it's not obvious to me how. \cc @llgcode. |
The issue is that the condition here is preventing saving the correct state of the dash for the next call to lineTo. So when the distance moved in a call to lineTo is too small compared to a dash segment, no progression through the dash space is possible. This results in either a blank or a solid line (why all the higher value dash segments above result in solid lines). This fixes it AFAICS:
This is still not correct (the dash lengths look odd in places - actually off by a factor of two when compared to the svg output which is clearly correct: use dashes |
Thanks for tracking this down. I think we should open a bug with draw2d. |
W00t! |
I found this result rather confusing a few weeks back thinking I had incomplete data until I discovered it was the plot itself. Here's a sample program and plot of the result
The text was updated successfully, but these errors were encountered: