-
Notifications
You must be signed in to change notification settings - Fork 20
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
segfault with cairo transform and matrix #222
Comments
Thanks for reporting. Please excuse the late response, I had some trouble with my PC monitor, the old one suddenly dyed, so I had to order a new one. The new one is a 32-inch 4k, really nice. Have some other work still, including fixing a few remaining issues in the Nim book, but will try to investigate your concern soon. |
Hey, don't worry I don't mind at all, we all have lives and you don't owe me anything. The transform was for shearing operation and it can be easily done with other ways so I can live without that at the moment. 32 inch screen must be awesome, you'll need a tiling wm with that or you'll end up losing windows ^^ Hope you'll have fun! |
Hello. Your observation is correct, the gintro Cairo matrix definition is very wrong. It should be a plain stack entity like cairo Rectangle and IntRectangle. Unfortunately, it is nearly impossible to detect automatically, which entities are stack allocated, and which are library created and have a proxy object in gintro. GtkTextIter is another example of such a stack entity, but we have a few more, in the generator script gen.nim is a list. So my initial idea was to just add cairo.Matrix to that list and be done. But surprisingly, in the GIR file the fields of that cairo matrix are not defined. That is strange, IntRectangle for example has fields. So the only solution is to define the Matrix type manual. Not difficult, but then we should test if it works. So my question: Do you really intend to use Cairo with gintro? I ask, because my impression is, that we have currently very very few gintro users. GTK has generally few users. And for cairo, the alternatives may be Pixie of Mr. treeform. Or Blend2d, for which we currently have no Nim bindings. And there are rumors that they try hard to break gintro for upcomming v2.0. I am currently not using Nim anymore. I try from time to time, but the fun and motivation is just gone. There have been a few insulting posts in Nim forum like https://forum.nim-lang.org/t/10101#66729 -- from Rumpf himself and his moderator fanboys. Nim is not a bad language, but when the fun is gone, it is just hard to continue using it. At least when no one pays for the work. I try to fix the remaining typos in the book, but even finding motivation for that is hard. Maybe I will try in next winter, or in a few years again some Nim? But well, there are enough other languages. So when you really should intend to use cairo with gintro, I can ship a patch tomorrow, but you would have to test it yourself. I will ask in Gnome forum why the GIR matrix has no fields. But whatever the answer is, it is very easy to fix manually. |
After the reply from Mr. Bassi, I have just pushed the fix. Cairo Matrix is now manually defined in cairoimpl.nim, and I patched gen.nim to skip the Matrix type. My feeling is, that the other procs in cairoimpl.nim are not affected by this change. But actually, I have no test code available for testing. I hope that this fix will not break gintro for other people, I don't think so, as the fix is tiny. Note that there are rumors that gintro will not install with latest Nim devil compiler! But v1.6.12 should work, I used that version myself some months ago. |
And of course head install with nimble uninstall gintro as we do not create releases any more, due to the 0.9.9 version number and for some other reasons as well. |
Hello, I am trying to use cairo tranform with this code, but I get a segfault, it looks like matrixIinit doesn't initialize the matrix or that transform doesn't understand it
I tried to understand the declarations in cairo.nim but I dont really get it
the doc tells this:
and cairo.nim
I wonder if matrixInit should call cairo_matrix_init with Matrix.impl instead
The text was updated successfully, but these errors were encountered: