In some cairo code I've been battling with I've found something particularly weird. here's an example, I'm hoping someone can confirm (i'm using vala). -- double x = 0.5; double y = 0; cr.set_source_surface(surface, x, y); cr.paint(); -- For some reason the surface gets vertically offset by 0.5px as well. In order to fix the bug I had to do this; -- int x = 0.5; // not really, but essentially the same code int y = 0; cr.set_source_surface(surface, x, y); cr.paint(); -- And the bug is gone :/
This is the expected behaviour. The x-,y-coordinates to cairo_set_source_surface() is an offset of the origin of the surface with respect to the current transformation origin, i.e. the position at which you wish the surface to appear. http://cairographics.org/manual/cairo-context.html#cairo-set-source-surface
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.