Comment 29 for bug 1538361

Revision history for this message
Alvin Penner (apenner) wrote :

Sorry, I'm on Windows, those instructions are like Greek to me, and they do not appear to be relevant.

however, here is an alternative approach. Instead of using the function sprintf, use the function g_sprintf.

So, for example, replace the call:
  sprintf(obuf,"transform=\"matrix(%lf,%lf,%lf,%lf,%lf,%lf)\"\n",cos(esc),-sin(esc),sin(esc),cos(esc),1.25*x,1.25*y);
with the call:
g_sprintf(obuf,"transform=\"matrix(%lf,%lf,%lf,%lf,%lf,%lf)\"\n",cos(esc),-sin(esc),sin(esc),cos(esc),1.25*x,1.25*y);

this has the advantage of keeping the format %lf. It appears to yield exactly the same benefits as the suggestion in comment 24 above, namely a correct transform matrix. In order to use this, you need to declare the header

#include <glib/gprintf.h>