summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXButton.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2014-10-18 18:50:15 (GMT)
committerKevin Walzer <kw@codebykevin.com>2014-10-18 18:50:15 (GMT)
commitadc51b8ef3945515d44a100acec3794981cae95f (patch)
treeea9c8ab28dc445a876cbd2b350a4580827a0e58b /macosx/tkMacOSXButton.c
parent5f4f2d6f94d730017b8c7f729926e2a9a7b7ed4b (diff)
downloadtk-adc51b8ef3945515d44a100acec3794981cae95f.zip
tk-adc51b8ef3945515d44a100acec3794981cae95f.tar.gz
tk-adc51b8ef3945515d44a100acec3794981cae95f.tar.bz2
Fix display of buttons on Cocoa if horizontally scrolled outside parent widget
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r--macosx/tkMacOSXButton.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index 58383ca..41436df 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -67,10 +67,11 @@ static NSRect TkMacOSXGetButtonFrame(TkButton *butPtr);
return;
}
+ /* Do not draw if the widget is completely outside of its parent, or within 50 pixels of the right border; this prevents buttons from being drawn on peer widgets as scrolling occurs. */
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) {
+ if (x > parent_width - 50 || x < 0) {
return;
}