backend_cairo.py clipping, bug in SVN

Hi everybody,

I believe a bug was introduced in revision 7002 of backend_cairo.py.
This code, in two places, now calls RendererCairo.convert_path with two arguments (ctx and tpath), whereas RendererCairo.convert_path expects three arguments. In one other place, RendererCairo.convert_path is called (correctly) with three arguments. One example of the code containing the bug is

tpath, affine = clippath.get_transformed_path_and_affine()
ctx.new_path()
affine = affine + Affine2D().scale(1.0, -1.0).translate(0.0, self.height)
tpath = affine.transform_path(tpath)
RendererCairo.convert_path(ctx, tpath)

Before this revision, the corresponding code was

tpath, affine = path.get_transformed_path_and_affine()
ctx.new_path()
affine = affine + Affine2D().scale(1.0, -1.0).translate(0.0, self.renderer.height)
RendererCairo.convert_path(ctx, path, affine)

RendererCairo.convert_path is defined as

   @staticmethod
    def convert_path(ctx, path, transform):

so with three arguments. Either the calls to convert_path are incorrect, or convert_path should be updated to handle two arguments.

--Michiel

Yeah -- this looks like a bad merge from the branch. The branch's version of convert_path takes two arguments, the trunk takes three because it was updated to support path simplification routines which do their own transformation. The trunk has been updated to use the three-argument form consistently (r7069).

Mike

Michiel de Hoon wrote:

···

Hi everybody,

I believe a bug was introduced in revision 7002 of backend_cairo.py.
This code, in two places, now calls RendererCairo.convert_path with two arguments (ctx and tpath), whereas RendererCairo.convert_path expects three arguments. In one other place, RendererCairo.convert_path is called (correctly) with three arguments. One example of the code containing the bug is

tpath, affine = clippath.get_transformed_path_and_affine()
ctx.new_path()
affine = affine + Affine2D().scale(1.0, -1.0).translate(0.0, self.height)
tpath = affine.transform_path(tpath)
RendererCairo.convert_path(ctx, tpath)

Before this revision, the corresponding code was

tpath, affine = path.get_transformed_path_and_affine()
ctx.new_path()
affine = affine + Affine2D().scale(1.0, -1.0).translate(0.0, self.renderer.height)
RendererCairo.convert_path(ctx, path, affine)

RendererCairo.convert_path is defined as

   @staticmethod
    def convert_path(ctx, path, transform):

so with three arguments. Either the calls to convert_path are incorrect, or convert_path should be updated to handle two arguments.

--Michiel

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
matplotlib-devel List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA