Gtk backend cut off / incorrect coordinates
kaber2 opened this issue · 4 comments
I'm trying to use the latest version (f7b0054) of mplcairo with the GTK3 backend. The canvas is contained on a page with multiple other widgets. What I see is that the plot is cut off, about 1/4th to 1/5th of the height is actually shown, and around 4/5 of the width. The plot contains a matplotlib multi-cursor, when moving it around the coordinates also don't match the mouse, there's a quite large offset in both x and y directions.
matplotlib has been installed according to your documentation, including the PRs, mplcairo has been installed from source. Please let me know if you need further information or would like me to try something for debugging.
Thanks!
Can you provide a minimal example to reproduce the issue? Right now what you describe doesn't ring a bell...
I also just pushed some new commits that include a version of the GTK3 backend (mplcairo.gtk) that is setup similarly to the other GUIs, i.e. fully relying on cairo's image backend to rasterize the figure before sending it to the windowing system (as opposed to mplcairo.gtk_native, that let Xlib take care of the rasterization). It may or may not work better for you.
Thanks for your quick response. Just a short update: I've tested with the new GTK backend and it does not show the same issue, however both the rendering and the even more the fonts are quite blurry. I've had seen the same issue with GTK Agg and also with Cairo when I was trying to speed up redraws by using a recording surface for caching, so it doesn't seem to be caused by the new backend.
Regarding the direct XLib backend, I'll try to come up with a minimal testcase, however it will take a few days due to new years.
I tried yet another rewrite of mathtext handling, which does not use cairo's recording surfaces anymore (which seem quite buggy...) but simply store a list of glyphs and rectangles to draw. In my experience it works a bit better, please give it a try.
Closing due to lack of activity, but feel free to ping me on the issue again.