in the SetImage mthod we added...
Why do we add the width and height to downPoint x and y. downPoint will always be 0/0 so why to why can't you just apply the width and size directly...
Problem: For some reason I cannot get currentPoint.x to be anything but zero. currntPoint.y gets a value but not currentPoint.x. Result is the image cannot be seen when it is opened. Clicking anywhere immediately makes it visible as a straight vertical line, then you can resize it. The width of my image is 128, so I tried assigning 128 directly and it still does not work.
Thanks for any help.
John
OK, I am wrong. currentPointer.x is getting the set. I was using NSLog to look at the value being set and apparently not doing that correctly. I can see it being set properly to 128 in the debugger.
Now the question is why doesn't the picture display when first opened?
I found the bug. I had the height parameter of NSmakeRect maxY=minY instead of maxY-minY.
Still curious as to why we are adding the height and width of the image to zero to set the points of the current rectangle.
Code:
downPoint = NSZeroPoint;
currentPoint.x = downPoint.x + imageSize.width;
currentPoint.y = downPoint.y + imageSize.height;
Why do we add the width and height to downPoint x and y. downPoint will always be 0/0 so why to why can't you just apply the width and size directly...
Code:
downPoint = NSZeroPoint;
currentPoint.x = imageSize.width;
currentPoint.y = imageSize.height;
Problem: For some reason I cannot get currentPoint.x to be anything but zero. currntPoint.y gets a value but not currentPoint.x. Result is the image cannot be seen when it is opened. Clicking anywhere immediately makes it visible as a straight vertical line, then you can resize it. The width of my image is 128, so I tried assigning 128 directly and it still does not work.
Thanks for any help.
John
OK, I am wrong. currentPointer.x is getting the set. I was using NSLog to look at the value being set and apparently not doing that correctly. I can see it being set properly to 128 in the debugger.
Now the question is why doesn't the picture display when first opened?
I found the bug. I had the height parameter of NSmakeRect maxY=minY instead of maxY-minY.
Still curious as to why we are adding the height and width of the image to zero to set the points of the current rectangle.