commit: Fix off by 1 pixel bugs.

From: msevior_at_physics.unimelb.edu.au
Date: Wed Nov 12 2003 - 16:49:06 EST

  • Next message: Marc Maurer: "Re: commit: Fix off by 1 pixel bugs."

    CVS: ----------------------------------------------------------------------
    CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
    CVS:
    CVS: Committing in .
    CVS:
    CVS: Modified Files:
    CVS: af/gr/cocoa/gr_CocoaGraphics.mm af/gr/qnx/gr_QNXGraphics.cpp
    CVS: af/gr/unix/gr_UnixGraphics.cpp af/gr/win/gr_Win32Graphics.cpp
    CVS: af/gr/xp/gr_Graphics.cpp af/gr/xp/gr_Graphics.h
    CVS: ----------------------------------------------------------------------
    Fix off by 1 pixel bugs.

    Caused by not properly taking the scrolll offset into account. I've fixed
    this on all platforms but I have only tested on Unix. Please test your own
    platform. If you're not sure what to do please ask me.

    Basically the layout assumed a location on the screen was given by

    (pos - scrollOffset)/scale

    Whereas the scroll code placed the position on the screen at

    pos/scale - scrollOffset/scale

    Giving rise to off by 1 pixel bugs from truncation.

    I've implemented protected methods in the graphics class _tduX(layout),
    tduY(layout) _tduR(layout) which correct for this.

    On unix I now have no pixel dirt and no flicker. At last!

    Cheers

    Martin



    This archive was generated by hypermail 2.1.4 : Wed Nov 12 2003 - 16:48:40 EST