Re: Screen <--> View Coordinate system conversion

2016-01-19 Thread Ken Thomases
On Jan 19, 2016, at 6:30 PM, Graham Cox wrote: > > OK, I got this working - thanks for all the help. > > There is a follow-up issue though. On 10.11 (others not yet tried), the > drawing only appears on the main screen. When I make my transparent window, I > size it to the union of all NSScree

Re: Screen <--> View Coordinate system conversion

2016-01-19 Thread Graham Cox
OK, I got this working - thanks for all the help. There is a follow-up issue though. On 10.11 (others not yet tried), the drawing only appears on the main screen. When I make my transparent window, I size it to the union of all NSScreens, thinking that would cover the entire desktop no matter h

Re: Screen <--> View Coordinate system conversion

2016-01-15 Thread Graham Cox
> On 16 Jan 2016, at 5:02 PM, Ken Thomases wrote: > > What is calling -setNeedsDisplayInRect:, in response to what event or > occurrence, and with what rect? It’s complicated, but events that start off in view1, and also draw stuff there, end up also drawing overlaid graphics in view2 (the o

Re: Screen <--> View Coordinate system conversion

2016-01-15 Thread Ken Thomases
On Jan 15, 2016, at 11:31 PM, Graham Cox wrote: > > What isn’t working is correctly setting the dirty rects when part of the view > needs to be refreshed. This is what has been leading me astray - because the > dirty region is misaligned, the drawing I’m doing is clipped, so it doesn’t > appea

Re: Screen <--> View Coordinate system conversion

2016-01-15 Thread Graham Cox
> On 16 Jan 2016, at 4:10 PM, Ken Thomases wrote: > > NSView* view1 = /* ... */; > NSRect rect = /* some rect in view1's internal coordinate space (relative to > its bounds, not its frame) */; > NSView* view2 = /* some view in another window */; > > rect = [view1 convertRect:rect toView:nil];

Re: Screen <--> View Coordinate system conversion

2016-01-15 Thread Ken Thomases
On Jan 15, 2016, at 10:27 PM, Graham Cox wrote: > > I have a need to draw as if to the entire screen as an overlay. > Where I’m having a problem is that I need the overlay content to match up to > objects drawn in another view, in another window. This view can be scrolled > and zoomed arbitrar

Re: Screen <--> View Coordinate system conversion

2016-01-15 Thread Roland King
> On 16 Jan 2016, at 12:27, Graham Cox wrote: > > > summary: view -> window -> screen -> window -> view > > > Tried this and many variants of it, nothing works - the coordinates I end up > with are not in the visible part of my overlay so don’t appear. > > > A better solution (i.e. less wo

Screen <--> View Coordinate system conversion

2016-01-15 Thread Graham Cox
I have a need to draw as if to the entire screen as an overlay. For this purpose I have created an invisible window that covers the entire desktop, and in that I have a view set as its contentView in which I can draw my content in the normal manner (-drawRect:, etc). The window and view are tran