Re: Rounding with #xywh=percent:25,25,50,50

On Wed, 06 Apr 2011 15:05:43 +0200, Silvia Pfeiffer  
<silviapfeiffer1@gmail.com> wrote:

> Yeah, I think we need to be more specific. My suggestion is to round
> up, but am curious what ppl think.

Do you mean that if the original rect (x, y, w, h) is (10.4, 20.5, 30.5,  
40.6), that all values are rounded up to give (11, 21, 31, 41)? That would  
cause a whole row and colums of pixels to the right and bottom to be  
included that might not have been intended.

To avoid adding up rounding errors from x+w or y+h, I would prefer  
transforming the (x, y, w, h) to a (left, top, right, bottom)  
representation (10.4, 20.5, 40.9, 61.1) and work on that. I would prefer  
one of:

1. rounding all values, giving (10, 21, 41, 61) -- closest fit

2. rounding "outwards", giving (10, 20, 41, 62) -- always includes the  
entire targeted region

3. rounding "inwards", giving (11, 21, 40, 61) -- never includes anything  
outside the targetet region

Some consistency with how CSS works would be great here, but I don't know  
how CSS works.

-- 
Philip Jägenstedt
Core Developer
Opera Software

Received on Wednesday, 6 April 2011 15:23:46 UTC