[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

drawing in an nscell subclass

From: Rob Burns
Subject: drawing in an nscell subclass
Date: Fri, 27 Feb 2004 14:07:30 +0700

I have the following bit of code in an subclass of NSCell, which draws a circle (or oval) in the middle of the cell. It works. the circle appears to be centered within the cell. But, I would expect the x and y origin offsets to be the same to get that behaviour. If I modify x and y offsets to be the same (3), and increase the height and width modifications to 6, like I would expect to have to do, the circle isn't centered. Is that the correct behavior?


- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView;
  NSBezierPath *circle;

  [_color set];
  circle = [NSBezierPath bezierPathWithOvalInRect: NSMakeRect(
    cellFrame.origin.y +3,
  [circle fill];

reply via email to

[Prev in Thread] Current Thread [Next in Thread]