Menu

#76 Invalid paint button into a container

open
nobody
None
5
2007-08-01
2007-08-01
No

When you paint a button that is into a container, the button override graphics clip rectangle to paint text, so, if the button is not all visible, only the visible part of the button should be painted, but, all text of the button is painted now.

Container.paintChildren method
------------------------------

...
g.setClip(x1, y1, x2 - x1 + 1, y2 - y1 + 1);

...
child.onPaint(g);

Button.paintButton method (called by paintChildren)
---------------------------------------------------

...
if (cutText) {
g.setClip(border, border, width - (border << 1), height - (border << 1));
}
...

regards

Discussion


Log in to post a comment.

Auth0 Logo