Cairo.copyPath yields null
BlitzMax Forums/Brucey's Modules/Cairo.copyPath yields null
| ||
Hello! I am currently trying to retrieve the "path" for a given "text" in order to apply additional transforms - but Cairo.copyPath always yields null: Cairo.setFontFace(self.TextFont.Face) if (self.TextSize <= 0) then Cairo.setFontSize(self.TextFont.Size) else Cairo.setFontSize(self.TextSize) end if Cairo.newPath() Cairo.TextPath(self.Text) local currentPath:TCairoPath = Cairo.copyPath() if (currentPath = null) then debugstop()always stops... If I replace the last three code lines of the above example by Cairo.showtext(self.Text) everything renders fine (which actually means that the whole Cairo setup is principally ok) Does anybody have any idea why I don't get the current path? Is there an alternative of getting it? [edit]Just to be complete: the code local Status:String = Cairo.StatusToString(Cairo.Status())yields "success" - thus, a memory overflow could not be the reason for the missing path. |
| ||
Does anybody have any idea why I don't get the current path? From looking at the code, I can tell you that there's a very good reason for that - there appears to be a bug. |
| ||
Brucey, I also looked into the (BlitzMAX part of the) source to see if I could tweak it a bit - but gave up due to my limited time...do you have any idea when you may fix it? (if it is possible that *you* fix it - rather than somebody from the Cairo developer team) Thanks in advance for your effort! |
| ||
As a quick fix, you can simply add the word "Return" to the copyPath() and copyPathFlat() methods. I'll try and commit the latest code (1.9.6) this weekend. |
| ||
Oh god, I must have been completely stoned not to see that "fix" - ok, my fault, thanks a lot for that hint! |