Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ public final void setModelBounds(Rectangle bounds) {
*/
public final Rectangle getAbsoluteBounds() {
Rectangle bounds = getBounds().getCopy();
// make relative to screen
// normalize screen location if root component
if (isRoot()) {
bounds.setLocation(0, 0);
return bounds;
}
// make relative to root component
{
AbstractComponentInfo parent = (AbstractComponentInfo) getParent();
while (parent != null) {
while (parent != null && !parent.isRoot()) {
bounds.performTranslate(parent.getBounds().getLocation());
parent = (AbstractComponentInfo) parent.getParent();
}
}
// make relative to root component
{
AbstractComponentInfo rootComponent = (AbstractComponentInfo) getRoot();
bounds.performTranslate(rootComponent.getBounds().getLocation().getNegated());
}
// OK, final result
return bounds;
}
Expand Down
Loading