diff options
author | Kevin Walzer <kw@codebykevin.com> | 2014-09-23 14:25:48 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2014-09-23 14:25:48 (GMT) |
commit | 4e98f2a1eacfe29f773b342d942cdf1e531f492b (patch) | |
tree | 53dab8dbe7d4ffa31e5859fb5040aa08d0f6cceb /macosx/tkMacOSXButton.c | |
parent | 0fd4f089bdedc31d5f442b5434cd69083dbe9484 (diff) | |
download | tk-4e98f2a1eacfe29f773b342d942cdf1e531f492b.zip tk-4e98f2a1eacfe29f773b342d942cdf1e531f492b.tar.gz tk-4e98f2a1eacfe29f773b342d942cdf1e531f492b.tar.bz2 |
Fine-tune display of buttons on Tk/Cocoa on horizontal scroll
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r-- | macosx/tkMacOSXButton.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 9858f88..f3405d7 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -66,6 +66,13 @@ static NSRect TkMacOSXGetButtonFrame(TkButton *butPtr); if ( y > parent_height - 20 || y + widget_height < 0 ) { return; } + + int parent_width = Tk_Width(Tk_Parent(tkwin)); + int widget_width = Tk_Width(tkwin); + int x = Tk_X(tkwin); + if (x > parent_width - 30 || x + widget_width < 0) { + return; + } } [super drawRect:dirtyRect]; } |