diff options
author | Teddy Wing | 2023-09-29 21:04:51 +0200 |
---|---|---|
committer | Teddy Wing | 2023-09-29 21:04:51 +0200 |
commit | 5a1c43d54396b9251a5181335532eca2a8f15be9 (patch) | |
tree | a89321d86103d5bb81f163c58f57e9063d0225a3 /src/Document.m | |
parent | 88c9a6b8775b5c97d21811b7f48a92eeeb5906c2 (diff) | |
download | Base-Windowed-Application-5a1c43d54396b9251a5181335532eca2a8f15be9.tar.bz2 |
Document: Trying to debug `cascade_offset`
Add some debug logs to see why the window cascade isn't shifting by the
height of a titlebar. `cascade_offset` appears to be changing values in
an inconsistent way and I haven't yet figured out what I'm doing wrong.
Diffstat (limited to 'src/Document.m')
-rw-r--r-- | src/Document.m | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Document.m b/src/Document.m index 609f0a6..eb467e3 100644 --- a/src/Document.m +++ b/src/Document.m @@ -1,6 +1,6 @@ #import "Document.h" -static NSPoint *cascade_offset; +static NSPoint *cascade_offset = NULL; @implementation Document @@ -13,7 +13,10 @@ static NSPoint *cascade_offset; NSLog(@"Setting cascade_offset"); NSPoint p = NSMakePoint(100, 100); cascade_offset = &p; - NSLog(@"Has set cascade_offset"); + NSLog(@"Has set cascade_offset x:%f y:%f", cascade_offset->x, cascade_offset->y); + } + else { + NSLog(@"init has cascade_offset x:%f y:%f", cascade_offset->x, cascade_offset->y); } _label = [[NSTextField alloc] @@ -73,12 +76,19 @@ static NSPoint *cascade_offset; | NSViewMaxYMargin]; // TODO: Cascade, store previous top-left position. + // Figure out why the cascade isn't cascading by enough. Try logging origin values. if (cascade_offset) { // cascade_offset = NSMakePoint(100, 100); NSLog(@"Yes"); + // default 21:03:08.812158+0200 Base Windowed Application makeWindowControllers cascade_offset x:-0.000000 y:-0.000000 + NSPoint o = *cascade_offset; + NSLog(@"makeWindowControllers cascade_offset x:%f y:%f", o.x, o.y); } *cascade_offset = [window cascadeTopLeftFromPoint:*cascade_offset]; + // NSPoint o = [window cascadeTopLeftFromPoint:*cascade_offset]; + // cascade_offset = &o; + NSLog(@"after setting cascade_offset x:%f y:%f", cascade_offset->x, cascade_offset->y); // cascade_offset = [window frame].origin; |