Bug 38117

Summary: cairo_show_glyphs sometimes draws in the wrong place with half pixel coords
Product: cairo Reporter: Martin Simmons <martin>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED MOVED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.10.2   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Example source code

Description Martin Simmons 2011-06-09 08:27:40 UTC
Created attachment 47775 [details]
Example source code

When using a transformation matrix that shifts by half a pixel, cairo_show_glyphs sometimes draws the first and/or second glyphs in the wrong place.

The effect varies depending on how much of the first glyph is visible in the region being redrawn (I think it is related to the clip region that gtk sets up).  I've tested this on Fedora 14.

I've attached an example that displays a window divided into three sections and also two strings "abc".  The bottom string is drawn with an offset of half a pixel horizontally relative to the top string.

Slightly different expose events can be generated to demonstrate the problem by clicking in different thirds of the window

In 1.10.2 and master, clicking in the left third of the window displays the correct strings.

In 1.10.2, clicking in the middle third of the window displays the "b" one pixel to the left of where it should be and clicking in the right third of the window displays both the "a" and the "b" one pixel to the left of where they should be.

In master, clicking in the middle or right thirds of the window displays the "b" one pixel to the left of where it should be.
Comment 1 GitLab Migration User 2018-08-25 13:47:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/201.

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.