diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2025-02-06 14:39:54 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2025-02-06 14:39:54 +0100 |
| commit | 9afb35f3a68e71fd2afbb77123eb0fde1835b409 (patch) | |
| tree | 71225a5d89c9c45fe88b76b8efef217c477a7452 | |
| parent | d60141bb71eae53ddd0711d83bfad829b59829e1 (diff) | |
fix macOS Sonoma/Sequoia not capturing OpenGL text on macOS - cont'd (#1197
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm index baa819621..ad309ee55 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm +++ b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm @@ -488,7 +488,9 @@ Fl_RGB_Image* Fl_Cocoa_Gl_Window_Driver::capture_gl_rectangle(int x, int y, int if (fl_mac_os_version >= 100600) { NSWindow *nswin = (NSWindow*)fl_mac_xid(pWindow); CGImageRef img_full = Fl_Cocoa_Window_Driver::capture_decorated_window_10_6(nswin); - CGRect cgr = CGRectMake(x, y, w, h); + int bt = [nswin frame].size.height - [[nswin contentView] frame].size.height; + bt *= (factor / Fl_Graphics_Driver::default_driver().scale()); + CGRect cgr = CGRectMake(x, y + bt, w, h); // add vertical offset to bypass titlebar CGImageRef cgimg = CGImageCreateWithImageInRect(img_full, cgr); // 10.4 CGImageRelease(img_full); Fl_RGB_Image *rgb = cgimage_to_rgb3(cgimg); |
