Mercurial > dwindows
changeset 2849:de56f1d265b3
Mac: Fix tree node icon and text overlapping on MacOS 13 Ventura.
The NSTableCellView frame reports a size of 0x0 on Ventura.
This causes our calculations to generate a negative value...
So check that the width is not zero before calculating.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 13 Nov 2022 19:54:17 +0000 |
parents | 6790bea27685 |
children | 2934b2fdcd8e |
files | mac/dw.m |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mac/dw.m Tue Oct 18 08:41:42 2022 +0000 +++ b/mac/dw.m Sun Nov 13 19:54:17 2022 +0000 @@ -2467,13 +2467,14 @@ NSImage *icon = [iv image]; NSTextField *tf = [result textField]; NSRect rect = result.frame; - int width =[icon size].width; - + CGFloat width = [icon size].width; + [iv setFrame:NSMakeRect(0,0,width,rect.size.height)]; - + /* Adjust the rect to allow space for the image */ rect.origin.x += width; - rect.size.width -= width; + if(rect.size.width) + rect.size.width -= width; [tf setFrame:rect]; } }