• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSCell drawWithFrame inView:: is off by 1 sometimes in an NSTableView? [solved]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCell drawWithFrame inView:: is off by 1 sometimes in an NSTableView? [solved]


  • Subject: Re: NSCell drawWithFrame inView:: is off by 1 sometimes in an NSTableView? [solved]
  • From: Dave Camp <email@hidden>
  • Date: Thu, 27 Jan 2005 16:04:21 -0800

I started noticing other odd table drawing artifacts, even when running the nib in IB. I deleted the table view and recreated it and all is well. I guess the nib file was corrupted. Weird.

Dave

On Jan 27, 2005, at 3:03 PM, Dave Camp wrote:

I've got a simple subclass of NSCell I'm putting in an NSTableColumn. The only method implemented looks like:

- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView
{
NSLog(@"%@", NSStringFromRect(cellFrame));
}


The problem is that when it's called to draw on mouse down and mouse up, cellFrame.origin.x is off by one from when I'm called to draw for other reasons. In working code, the image I'm drawing offsets by one pixel to the right on mouse down and mouse up, but draws normally in other cases. Log output looks like:

{{749, 235}, {18, 16}} - Normal draw
{{750, 235}, {18, 16}} - Mouse down. Note that the X is off by one
{{750, 235}, {18, 16}} - Mouse up. Still off by one
{{750, 235}, {18, 16}} - Mouse down
{{750, 235}, {18, 16}} - Mouse up
{{749, 235}, {18, 16}} - Resize window or deselect, or any other non-mouse draw response


I've also tried implementing drawWithFrame:inView: but it has the same problem.

I thought this might be some sort of default button offsetting on mouse down, but if that was the case the Y should change on mouse down and the offsets should be removed on mouse up. I'm not seeing that.

Anyone know what's going on here?

Thanks,
Dave
---
Among the chief weapons of UNIX:  Fear, surprise and ruthless efficiency.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden


---
It's not denial. I'm just very particular about the reality I choose to accept.  -Calvin


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSCell drawWithFrame inView:: is off by 1 sometimes in an NSTableView? (From: Dave Camp <email@hidden>)

  • Prev by Date: Re: NSDocument/NSSavePanel and controlling filenames [partially solved]
  • Next by Date: Re: May I pack java in a dylib?
  • Previous by thread: NSCell drawWithFrame inView:: is off by 1 sometimes in an NSTableView?
  • Next by thread: [ANN]RBSplitView 1.0.1
  • Index(es):
    • Date
    • Thread