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
So there is this issue elsewhere Twinside/Rasterific#53 and I need to provide some debug output which in turn requires me to feed in a Drawing type thing. I am not sure how to go about rendering my diagram to that type. It seems that renderDia can only give me an Image, which is a later stage of the diagram's lifeline.
The text was updated successfully, but these errors were encountered:
So unfortunately there is no really easy way to do this. The definition of renderRTree for the Backend Rasterific instance compiles the diagram to a Drawing and then immediately renders it without ever giving access to the intermediate result. You can see the code here:
One solution would be to manually call the part of the definition up to the Drawing, but this is a bit complicated by the fact that you would have to manually compose it with the other things the generic renderDia is doing (rescaling, centering, etc. --- see https://github.com/diagrams/diagrams-core/blob/master/src/Diagrams/Core/Compile.hs#L188) to get all the coordinates to come out right . Another option, but also annoying, would be to copy the entirety of Diagrams.Backend.Rasterific and modify the Backend instance to have type Result Rasterific V2 n = (Image PixelRGBA8, Drawing) or something like that. Then modify the renderRTree method to return a pair, like (R.renderDrawing (round w) (round h) bgColor r, r).
So there is this issue elsewhere Twinside/Rasterific#53 and I need to provide some debug output which in turn requires me to feed in a
Drawing
type thing. I am not sure how to go about rendering my diagram to that type. It seems thatrenderDia
can only give me anImage
, which is a later stage of the diagram's lifeline.The text was updated successfully, but these errors were encountered: