Cairo::Surface->create_for_rectangle vs. $surf->create_similar
- From: Torsten Schoenfeld <kaffeetisch gmx de>
- To: gtk-perl-list gnome org
- Subject: Cairo::Surface->create_for_rectangle vs. $surf->create_similar
- Date: Wed, 03 Aug 2011 22:12:53 +0200
I recently wrapped cairo_surface_create_for_rectangle for Cairo. The
natural syntax seemed to be
Cairo::Surface->create_for_rectangle($target, $x, $y, $width, $height)
But I now realize that this is at odds with the wrapper for
cairo_surface_create_similar which was written a long time ago:
$old->create_similar($content, $width, $height)
But since create_similar() really is a constructor, not a method, I now
think this would make more sense:
Cairo::Surface->create_similar($old, ...)
What would you prefer?
a) wrap cairo_surface_create_for_rectangle as
$target->create_for_rectangle($target, ...) to maintain similarity with
create_similar()
b) wrap cairo_surface_create_for_rectangle as
Cairo::Surface->create_for_rectangle($target, ...) and make it possible
to use Cairo::Surface->create_similar($old, ...)¹
¹ In addition to the old syntax, of course.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]