Adding Spit and Polish to Your Cocoa App
Subject:   my zooming broke somewhere in devp't
Date:   2002-06-22 09:50:52
From:   psheldon
I may have extreme confusion isolating where the mistake is. I've gotten to page 5 of spit and polish and noticed this error in my zooming.

I don't know whether revision control notions I heard 20 years ago have ever been refined, but I sure know my revisions were out of control, as you will see.

Mike Beam's image app from both working with bitmaps 1 and 2 did zoom right. In particular, Mike's image doesn't distort on my drag of lower right corner window reshaper, mine does.

Michele suggested more code for dragging in working with bitmaps article 1. For some reason, I put this in a folder for working with bitmaps article 2. Since I chose to put it in #2, I am not sure whether I added Michele's code to article 2's code or article 1's. I did working wth bitmaps article 3 on top of that revision wherein I first observed that zooming broke.

Here's what happens :

(at first glance impressions)

At 100% my image is "right". I zoom down to 50% and I see (at least) two jumps of 50% but things settle down to about three jumps netting about an 8 times rescaling. I had the impression there might have been both horizontal and vertical rescalings in time sequence.

I don't know how to slow down the graphics of os x so my brain can follow how many jumps there are in this "first glance set of impressions". Steve Jobs did genie with slow motion; I can't.

Isolation choice : Since Michele's drag code is older than the stuff I build on top of it, it will have less to search amongst than code build on top of it. I can use debugger and step through slow graphics changes.

scaleimageto's [[self window] zoom:nil] line called windowwillusestandardframe though, somehow, I couldn't step into windowwillusestandardframe. Passing through gave no overkill zoom on 50% from 100%. It, however, returned standard frame to something else that resized the window. But, recall, I observed that dragging the lower right corner to resize the "containing" window also resized the image. That could have compounded the zooming, you see.

Candidate methodology : How do I find that something else called?

I don't know how, other than flagging all methods in debugger to see "finer resolution" (of calls) on that scaleimageto's [[self window] zoom:nil] line. This methodology is bad on two counts. It is both highly inefficient, forcing slow stepping through of everything irrelevant, and might miss things called other than in my code, eg. in the frameworks.

1 to 1 of 1
  1. my zooming broke somewhere in devp't
    2002-06-25 04:09:19  michele [View]

    • NSLog experiments #1
      2002-06-27 22:00:10  psheldon [View]

      • NSLog experiments #2
        2002-06-29 08:36:54  psheldon [View]

    • recoded on top of Mike's code, strange zooming and dragging
      2002-06-27 14:56:13  psheldon [View]

    • mixing code sense or no sense, thanks
      2002-06-26 22:23:38  psheldon [View]

1 to 1 of 1