[interfacekit] Re: archiving...


> That's perfectly normal, from the BeBook:
>
> "The sides of the view must be aligned on screen pixels. Therefore, the
> frame rectangle should not contain coordinates with fractional values.
> Fractional coordinates will be rounded to the first lower whole number
(for
> example 1.2 will be rounded down to 1.0)."
>
> As long as a view is not connected to a window, it can have float
> coordinates. The moment it is attached, the coordinates are rounded and
sent
> to the app_server. The app_server works with ints for it's window/view
> coordinates. If you request things like Bounds/Frame when attached, the
> values are requested from the app_server, and thus are rounded values.

    Yes, I know that coordinates must be rounded before being sent to
app_server. What I am concerned about is that the real coordinates are not
kept! In my implementation of BView, the coordinates are rounded in some
temporary floats, and these temporary floats are sent to app_server, leaving
original coordinates unchanged. The same happens when BView::Frame() is
called.
    If we change them, printing won't reflect the real positions any more,
and, this would look *very* bad on a paper since the display works with
72dpi(IIRC)[or 92dpi?] and printers with hundreds or thousands dpi(s).

>
> We have to follow it, if we want to be backwards compatible.

    It will be. Frame()/Bounds()/LeftTop/... will return rounded values.

> There are nice

    nice? :))

> side-effects, for example the following code
>
> for (int32 i = 0; i < 10; i++)
> view->MoveBy(0.1f, 0.0f);
>
> moves the view by one pixel if not attached, but doesn't move it at all
when
> attached. This is because when not attached it does
> fCachedBounds.MoveBy(0.1f, 0.0f), and when attached it sends 0.1f and 0.0f
> as int32's, which means 0 and 0 :).
>



Other related posts: