From 88cba089b2cd3c72819e60d9a95a22d90d9ecbc4 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 23 Feb 2012 15:19:34 +0100 Subject: [PATCH] EA-33544 - IAE: DataManagerImpl.getDataContext --- .../openapi/actionSystem/impl/ActionPopupMenuImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionPopupMenuImpl.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionPopupMenuImpl.java index f65b294f6fd1..c67736de844e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionPopupMenuImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionPopupMenuImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,8 +88,8 @@ final class ActionPopupMenuImpl implements ActionPopupMenu, ApplicationActivatio // Fill menu. Only after filling menu has non zero size. - int x2 = Math.min(Math.max(0, x), component.getWidth() - 1); // fit x into [0, width-1] - int y2 = Math.min(Math.max(0, y), component.getHeight() - 1); // fit y into [0, height-1] + int x2 = Math.max(0, Math.min(x, component.getWidth() - 1)); // fit x into [0, width-1] + int y2 = Math.max(0, Math.min(y, component.getHeight() - 1)); // fit y into [0, height-1] myContext = myDataContextProvider != null ? myDataContextProvider.get() : DataManager.getInstance().getDataContext(component, x2, y2); Utils.fillMenu(myGroup, this, true, myPresentationFactory, myContext, myPlace, false, false);