Open GoogleCodeExporter opened 9 years ago
That's was not solving my problem in all cases.
Because the DeviceScreen.repaint method (called by Component.repaint), add an Y
offset in case of having a Title Bar.
Now that I store in Component.x and Component.y the absolute location, then
this
shifting is not wanted anymore
All is fine now using the following code in DeviceScreen
public void repaint (int x, int y, int width, int height)
{
// if ( hasTitleBar() )
// {
// // Offset the user's y by the height of the title bar.
// Theme theme = UIManager.getTheme();
// int titleHeight = theme.getTitleHeight();
// y += titleHeight;
// }
slave.repaint( x, y, width, height );
}
note that I must also Ignore the titleHeight translation on Pointer Events
in DeviceScreen.pointerPressed :
if ( processed == false )
{
// Adjust the press location to fit in the canvas area.
int py = y;
// if ( hasTitle )
// {
// py -= theme.getTitleHeight();
// }
// Forward the event.
master.pointerPressed( x, py );
}
// Continue processing the pointer event.
super.pointerPressed( x, y );
Original comment by jmherme...@gmail.com
on 14 Feb 2008 at 1:45
Related to components contained within each other. This will be a J4ME 1.1
issue.
Original comment by deanbro...@gmail.com
on 8 Mar 2008 at 1:28
Original comment by deanbro...@gmail.com
on 8 Mar 2008 at 1:29
Original issue reported on code.google.com by
jmherme...@gmail.com
on 14 Feb 2008 at 10:57