Re: drawRect runs twice, bounds are changed in between

2015-01-29 Thread N!K
Thank you. On Jan 28, 2015, at 8:30 PM, Graham Cox graham@bigpond.com wrote: On 29 Jan 2015, at 3:05 pm, N!K pu56ucl...@alumni.purdue.edu wrote: NSBezierPath* temp; is in the list of declarations. This snippet is in drawRect: NSAffineTransform* tfm = [[NSAffineTransform

Re: drawRect runs twice, bounds are changed in between

2015-01-28 Thread N!K
Uti, Looking further into your uncertainty about where temp comes from (see previous email, below) reveals a possible memory leak. NSBezierPath* temp; is in the list of declarations. This snippet is in drawRect: NSAffineTransform* tfm = [[NSAffineTransform alloc] init];

Re: drawRect runs twice, bounds are changed in between

2015-01-28 Thread Graham Cox
On 29 Jan 2015, at 3:05 pm, N!K pu56ucl...@alumni.purdue.edu wrote: NSBezierPath* temp;is in the list of declarations. This snippet is in drawRect: NSAffineTransform* tfm = [[NSAffineTransform alloc] init]; [tfm scaleXBy:scaleX yBy:scaleY]; temp = [tfm

Re: drawRect runs twice, bounds are changed in between

2015-01-17 Thread N!K
On Jan 16, 2015, at 5:30 AM, Uli Kusterer witness.of.teacht...@gmx.net wrote: On 15 Jan 2015, at 07:58, Quincey Morris quinceymor...@rivergatesoftware.com wrote: Putting those two ideas together leads to a better approach. Create the bezier path once, relative to an arbitrary bounding rect

Re: drawRect runs twice, bounds are changed in between

2015-01-16 Thread Uli Kusterer
On 15 Jan 2015, at 07:58, Quincey Morris quinceymor...@rivergatesoftware.com wrote: Putting those two ideas together leads to a better approach. Create the bezier path once, relative to an arbitrary bounding rect — say 1000 x 1000. (But any rect would do.) When you need to draw the path, set

Re: drawRect runs twice, bounds are changed in between

2015-01-15 Thread Steve Christensen
Would the Managing Live Resize methods of NSView (https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/#//apple_ref/doc/uid/2014-SW41) be helpful? The docs for -viewWillStartLiveResize suggest that that would be a good place to prepare

Re: drawRect runs twice, bounds are changed in between

2015-01-15 Thread Graham Cox
On 15 Jan 2015, at 3:39 pm, N!K pu56ucl...@alumni.purdue.edu wrote: I’m trying to learn more about drawing. One stumbling block was getting an NSBezierPath to change size proportional to the window size when the corner is dragged. Per Graham Cox’s suggestion, the view size change can be

Re: drawRect runs twice, bounds are changed in between

2015-01-14 Thread N!K
On Jan 13, 2015, at 10:55 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Jan 13, 2015, at 21:25 , N!K pu56ucl...@alumni.purdue.edu wrote: I have not been able to find a reason for this behavior. . I don’t know how to reveal the point between passes where bounds is

Re: drawRect runs twice, bounds are changed in between

2015-01-14 Thread N!K
On Jan 13, 2015, at 10:50 PM, Jens Alfke j...@mooseyard.com wrote: On Jan 13, 2015, at 9:25 PM, N!K pu56ucl...@alumni.purdue.edu wrote: A breakpoint at the end of drawRect shows that it runs twice. After the second pass, the view appears, as it should. Between passes, bounds is changed

Re: drawRect runs twice, bounds are changed in between

2015-01-14 Thread Quincey Morris
On Jan 14, 2015, at 20:39 , N!K pu56ucl...@alumni.purdue.edu wrote: I’m trying to learn more about drawing. One stumbling block was getting an NSBezierPath to change size proportional to the window size when the corner is dragged. This is the wrong way to approach the problem. Scaling the

Re: drawRect runs twice, bounds are changed in between

2015-01-13 Thread Jens Alfke
On Jan 13, 2015, at 9:25 PM, N!K pu56ucl...@alumni.purdue.edu wrote: A breakpoint at the end of drawRect shows that it runs twice. After the second pass, the view appears, as it should. Between passes, bounds is changed somehow, as shown by NSLog at the start and end of drawRect.

Re: drawRect runs twice, bounds are changed in between

2015-01-13 Thread Quincey Morris
On Jan 13, 2015, at 21:25 , N!K pu56ucl...@alumni.purdue.edu wrote: I have not been able to find a reason for this behavior. . I don’t know how to reveal the point between passes where bounds is actually changed. It does not happen in any other NSView projects of mine; drawRect runs only