Faster Scroller

  • Hello,
    someone could tell me how can I make the scrolling system of my NSView
    faster?
    My project can be downloaded here:
    http://www.torellasoft.com/download/progetto.sit

    Thanx,
    Luca
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Thursday, January 23, 2003, at 10:27 AM,
    <cocoa-dev-request...> wrote:

    > Hello,
    > someone could tell me how can I make the scrolling system of my NSView
    > faster?
    > My project can be downloaded here:
    > http://www.torellasoft.com/download/progetto.sit
    >

    When the drawRect: method gets called on your view, the rectangle that
    gets passed in tells you what portion of the view actually needs to be
    redrawn.  Currently, you are ignoring this parameter and redrawing
    everything in your view (even the stuff that is not visible) each time
    drawRect: is called.  To speed up your drawing, you should look at that
    rectangle parameter and only draw the portion of your view that lies
    within that rectangle.

    --
    Brian Webster
    <bwebster...>
    http://homepage.mac.com/bwebster
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Thursday, Jan 23, 2003, at 07:38 US/Pacific, Luca Torella wrote:

    > Hello,
    > someone could tell me how can I make the scrolling system of my
    > NSView faster?
    > My project can be downloaded here:
    > http://www.torellasoft.com/download/progetto.sit
    >
    >

    I do not know if you got it to be faster but you loops should be:

    int maxh;
    h = NSMinY(rect)/zoom;
    maxh = NSMaxY(rect)/zoom;
    for (  ; h<=maxh ; h++) {
    int maxl;
    l = NSMinX(rect)/zoom;
    maxl = NSMaxX(rect)/zoom;
    for ( ; l<=maxl ; l++) {

    }
    }

    and you should check that the rectangle which you are drawing
    intersects with the drawRect that gets passed in.
    Do not just check to see that you intersects because it is still slow
    for large rows by columns.

    Thanks,
    Andrew Pinski
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
previous month january 2003 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