You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a drawRect the resulting drawn rectangle looks fine in java, but the resulting pdf export has gaps in the corner points.
When the drawRect is replace by four drawLine calls the rectangle is drawn fine.
It is not clear why this happens as the drawRect (not overridden) ultimately calls drawLine itself.
Currently the simple workaround is to use drawLine instead of drawRect
The text was updated successfully, but these errors were encountered:
This happens because drawRect(int,int,int,int) was defined at a time when there was only some bitmap output for graphics. But depending on your stroke and matrix you are of course getting gabs. In PDF you have "high precission" because you are not aligning on a pixel raster. I.e. that drawLine()'s might not overlap is rather likely on PDFs when you BasicStroke has not at least on 1px width (but what is pixel width in PDF ...)
=> The right fix will be to override drawRect() and do just a draw(new Rectangle2D.Float(...)).
When using a drawRect the resulting drawn rectangle looks fine in java, but the resulting pdf export has gaps in the corner points.
When the drawRect is replace by four drawLine calls the rectangle is drawn fine.
It is not clear why this happens as the drawRect (not overridden) ultimately calls drawLine itself.
Currently the simple workaround is to use drawLine instead of drawRect
The text was updated successfully, but these errors were encountered: