Have our host tell us the view bounds rather than assuming they are
widthxheight+0+0. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1102 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: RadialMenu.java,v 1.3 2003/04/16 22:50:55 mdb Exp $
|
// $Id: RadialMenu.java,v 1.4 2003/04/22 22:04:55 mdb Exp $
|
||||||
|
|
||||||
package com.samskivert.swing;
|
package com.samskivert.swing;
|
||||||
|
|
||||||
@@ -48,6 +48,14 @@ public class RadialMenu
|
|||||||
*/
|
*/
|
||||||
public Component getComponent ();
|
public Component getComponent ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Requests the bounds of the visible region in which we'll be
|
||||||
|
* rendering the menu. The menu will be constrained to fit within
|
||||||
|
* these bounds starting with a natural position around the
|
||||||
|
* supplied target bounds and adjusting minimally to fit.
|
||||||
|
*/
|
||||||
|
public Rectangle getViewBounds ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests that the appropriate region of the host be repainted.
|
* Requests that the appropriate region of the host be repainted.
|
||||||
*/
|
*/
|
||||||
@@ -562,7 +570,7 @@ public class RadialMenu
|
|||||||
|
|
||||||
// now make sure the whole shebang is fully visible within the
|
// now make sure the whole shebang is fully visible within the
|
||||||
// host component
|
// host component
|
||||||
Rectangle hbounds = new Rectangle(_host.getComponent().getSize());
|
Rectangle hbounds = _host.getViewBounds();
|
||||||
Point pos = SwingUtil.fitRectInRect(_bounds, hbounds);
|
Point pos = SwingUtil.fitRectInRect(_bounds, hbounds);
|
||||||
_bounds.setLocation(pos);
|
_bounds.setLocation(pos);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user