NSOpenGLView in NSScrollView problem

  • Hi everyone,

    I put several NSOpenGLView subclasses instances in a NSScrollView.
    The problem is when I scroll down, the NSOpenGLView that is partly
    visible,
    and we only see the top of it, I expect that I would see only
    the top of associated opengl viewport, but it doesn't.
    What is displayed is the bottom of it, it does not clip correctly.

    It' kind of hard to explain so I attached a picture to depict the
    problem.

    http://img210.imageshack.us/img210/6845/sketchts4.png
    OR
    http://img210.imageshack.us/my.php?image=sketchts4.png

    Regards.
  • I had previously implemented a thumbnail of opengl views, which looks
    similar to what you're doing.  The problem is likely in how the opengl
    viewport is specified in your view class.  It's been a while since
    I've looked at this and I'm not sure I've ever really understood the
    rationale, but I know the code I use is (effectively)

    NSRect r = [view visibleRect];
    vp[0] = 0;
    vp[1] = 0;
    vp[2] = (GLint)NSWidth(r);
    vp[3] = (GLint)NSHeight(r);

    Rather than the more intuitive

    vp[0] = (GLint)NSMinX(r);
    vp[1] = (GLint)NSMinY(r);

    dave

    On 10-Oct-07, at 10:45 PM, Half Activist wrote:

    > Hi everyone,
    >
    > I put several NSOpenGLView subclasses instances in a NSScrollView.
    > The problem is when I scroll down, the NSOpenGLView that is partly
    > visible,
    > and we only see the top of it, I expect that I would see only
    > the top of associated opengl viewport, but it doesn't.
    > What is displayed is the bottom of it, it does not clip correctly.
    >
    > It' kind of hard to explain so I attached a picture to depict the
    > problem.
    >
    > http://img210.imageshack.us/img210/6845/sketchts4.png
    > OR
    > http://img210.imageshack.us/my.php?image=sketchts4.png
    >
    > Regards.
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today