changeset 1302:dc1043f1fde4

Fixed RT-21645: On Mac OS X call to GlassViewEventHandler.getInputMethodCandidatePos() provides strange coordinates
author leifs
date Wed, 13 Jun 2012 18:45:11 -0700
parents 14efe4fc1d6a
children 6f9959b35a9d
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Wed Jun 13 14:40:15 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Wed Jun 13 18:45:11 2012 -0700
@@ -690,8 +690,9 @@
 
             x = bounds.getMinX();
             y = bounds.getMinY();
-            width = bounds.getWidth();
-            height = bounds.getHeight();
+            // Sometimes the bounds is empty, in which case we must ignore the width/height
+            width  = bounds.isEmpty() ? 0 : bounds.getWidth();
+            height = bounds.isEmpty() ? 0 : bounds.getHeight();
         }
 
         Bounds textBounds = textGroup.getBoundsInParent();