Bug 19584 - Setting x co-ords as double appears to affect y co-ords too in set_source_surface
Summary: Setting x co-ords as double appears to affect y co-ords too in set_source_sur...
Status: RESOLVED NOTABUG
Alias: None
Product: cairo
Classification: Unclassified
Component: xlib backend (show other bugs)
Version: 1.8.0
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-15 07:43 UTC by Karl Lattimer
Modified: 2009-01-24 10:26 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Karl Lattimer 2009-01-15 07:43:14 UTC
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 :/
Comment 1 Chris Wilson 2009-01-24 10:26:07 UTC
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.