[SURVEY] Should y=0 be at the top or bottom of the document?

10 views
Skip to first unread message

Gregory Brown

unread,
Dec 5, 2009, 10:32:02 AM12/5/09
to Prawn
Hi folks,

I never thought I'd see the day, but we're considering the possibility
of swapping the y axis so that 0 is at the top of the document.
While we won't make a decision directly based off of this survey, it
surely will help us make a more educated decision. To limit the
population a bit, we're asking that only existing contributors
register a vote. (But there are a lot of those, maybe 50 or so by
now)

So... if you have a patch (large or small) that has been accepted into
any of prawn-core, prawn-layout, prawn-security, or prawn-format,
please respond with a link to a commit on github for authentication,
and the following number based on your choice:

Do you think that we should change Prawn's coordinate system so that
y=0 is at the top of the document?

-2: No, I'd hate that.
-1: It would have been nice early on, but it's too late now.
+0: no preference
+1: It would be nice, but not that important
+2: Yes, definitely

I will respond now with my vote, which can be used as an example for
further responses. Please don't post discussion to this thread,
start another one if you want to discuss anything related to this.

Gregory Brown

unread,
Dec 5, 2009, 10:35:00 AM12/5/09
to Prawn
On Sat, Dec 5, 2009 at 10:32 AM, Gregory Brown
<gregory...@gmail.com> wrote:

> Do you think that we should change Prawn's coordinate system so that
> y=0 is at the top of the document?

-2: No, I'd hate that.

http://github.com/sandal/prawn/commit/722604019a24f0961dcff5d65206ded5f8fab778

Daniel Nelson

unread,
Dec 5, 2009, 10:38:28 AM12/5/09
to prawn...@googlegroups.com
> Do you think that we should change Prawn's coordinate system so that
> y=0 is at the top of the document?

+0: no preference

http://github.com/sandal/prawn/commit/6da307a86c43dfecf48c3105a1f4c39b380f3dd6

Brad Ediger

unread,
Dec 5, 2009, 11:11:08 AM12/5/09
to prawn...@googlegroups.com
On Sat, Dec 5, 2009 at 9:32 AM, Gregory Brown <gregory...@gmail.com> wrote:
> Do you think that we should change Prawn's coordinate system so that
> y=0 is at the top of the document?

-1: It would have been nice early on, but it's too late now.

http://github.com/madriska/prawn-security/commit/7dd4b64a36072bc67094e26299bff04d091b0631

Henrik Nyh

unread,
Dec 5, 2009, 11:20:44 AM12/5/09
to prawn...@googlegroups.com
On Sat, Dec 5, 2009 at 16:32, Gregory Brown <gregory...@gmail.com> wrote:
> So... if you have a patch (large or small) that has been accepted into
> any of prawn-core, prawn-layout, prawn-security, or prawn-format,
> please respond with a link to a commit on github for authentication,
> and the following number based on your choice:
>
> Do you think that we should change Prawn's coordinate system so that
> y=0 is at the top of the document?
>
> -2: No, I'd hate that.
> -1: It would have been nice early on, but it's too late now.
> +0: no preference
> +1: It would be nice, but not that important
> +2: Yes, definitely

http://github.com/sandal/prawn/commit/bd3c9dd4e48686489cac1145caf78a9d4e15c285

+1

Sam LG

unread,
Dec 5, 2009, 12:20:10 PM12/5/09
to Prawn
This will betray my ignorance of the PDF format, but: how about a +/-3
option for "whatever PDF uses"? (=

Personally, I'm used to 0 at the top [and I've already had to write a
function converting my y-coordinates to Prawn's], so:
> +1: It would be nice, but not that important

-Sam

Sam LG

unread,
Dec 5, 2009, 12:21:52 PM12/5/09
to Prawn

Chris Schumann

unread,
Dec 6, 2009, 9:07:52 AM12/6/09
to prawn...@googlegroups.com
http://github.com/torgoton/prawn/commit/49f2ee8d35203fc3de8c72a1a1f4e9f8cdffdcb3

My gut answer:
+2: Yes, definitely

Discussion elsewhere.

Gunnar Wolf

unread,
Dec 6, 2009, 11:46:07 AM12/6/09
to prawn...@googlegroups.com
Gregory Brown dijo [Sat, Dec 05, 2009 at 10:32:02AM -0500]:

> Do you think that we should change Prawn's coordinate system so that
> y=0 is at the top of the document?
>
> -2: No, I'd hate that.
> -1: It would have been nice early on, but it's too late now.
> +0: no preference
> +1: It would be nice, but not that important
> +2: Yes, definitely

-1: It would have been nice early on, but it's too late now.

I'd hate to go over all of my code changing the logic to what would
seem natural - including the places where I reverse the logic ;-)

--
Gunnar Wolf • gw...@gwolf.org(+52-55)5623-0154 / 1451-2244

signature.asc

Gunnar Wolf

unread,
Dec 6, 2009, 11:47:57 AM12/6/09
to prawn...@googlegroups.com
Gunnar Wolf dijo [Sun, Dec 06, 2009 at 10:46:07AM -0600]:
> -1: It would have been nice early on, but it's too late now.
>
> I'd hate to go over all of my code changing the logic to what would
> seem natural - including the places where I reverse the logic ;-)

Of course, I have no say as I have no patches, sorry for the noise. I
am packaging Prawn for Debian, but that's not _in_ prawn. So feel free
to ignore me.

Peter Seebach

unread,
Dec 6, 2009, 3:32:11 PM12/6/09
to prawn...@googlegroups.com
In message <b37300880912050732r425...@mail.gmail.com>, Grego
ry Brown writes:
>I never thought I'd see the day, but we're considering the possibility
>of swapping the y axis so that 0 is at the top of the document.

Please yes.

>So... if you have a patch (large or small) that has been accepted into
>any of prawn-core, prawn-layout, prawn-security, or prawn-format,
>please respond with a link to a commit on github for authentication,
>and the following number based on your choice:

I don't think I've done that; all I've done is submit a couple of
patches through the tracker. But you can see my patches (one of which fixes
the indent() function to work with column boxes, which I figure counts for
something) on the tracker.

>Do you think that we should change Prawn's coordinate system so that
>y=0 is at the top of the document?

I'd go with +2 yes.

Here's why: Stretchy bounding boxes.

In a stretchy bounding box, any time you add text, pdf.cursor == 0. This
makes it USELESS to, say, record the current cursor value, then try to move
back to it later.

Basically, y should grow in the same direction that stretchy boxes do, and
I'm pretty sure that stretchy boxes should grow down.

-s

James Healy

unread,
Dec 7, 2009, 6:37:46 AM12/7/09
to prawn...@googlegroups.com
Sam LG wrote:
> This will betray my ignorance of the PDF format, but: how about a +/-3
> option for "whatever PDF uses"? (=

By default, PDF has the origin in the bottom left which is why prawn has
the same. It involved less code when the project was bootstrapped.

-- James Healy <ji...@deefa.com> Mon, 07 Dec 2009 22:37:29 +1100

James Healy

unread,
Dec 7, 2009, 6:41:32 AM12/7/09
to prawn...@googlegroups.com
Gregory Brown wrote:
> Do you think that we should change Prawn's coordinate system so that
> y=0 is at the top of the document?
>
> -2: No, I'd hate that.
> -1: It would have been nice early on, but it's too late now.
> +0: no preference
> +1: It would be nice, but not that important
> +2: Yes, definitely
>
> I will respond now with my vote, which can be used as an example for
> further responses. Please don't post discussion to this thread,
> start another one if you want to discuss anything related to this.

-1: It would have been nice early on, but it's too late now.

http://github.com/sandal/prawn/commit/a1c0c2874d84c13157e6aa6326603d7c5299f5cc

-- James Healy <ji...@deefa.com> Mon, 07 Dec 2009 22:41:26 +1100
Reply all
Reply to author
Forward
0 new messages