[Title] don't trim a whole image when HW key is released
authorgiwoong.kim <giwoong.kim@samsung.com>
Tue, 11 Sep 2012 07:06:36 +0000 (16:06 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Tue, 11 Sep 2012 07:06:36 +0000 (16:06 +0900)
[Type] enhancement
[Module] Emulator / skin
[Priority] major
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java

index 93c9aad..67232e6 100644 (file)
@@ -643,7 +643,8 @@ public class EmulatorSkin {
                                        int keyCode = SkinUtil.getHardKeyCode( e.x, e.y, currentRotationId, currentScale );
 
                                        if ( SkinUtil.UNKNOWN_KEYCODE != keyCode ) {
-                                               // null check : prevent from mouse up without a hover (ex. doing always on top in hardkey area)
+                                               /* null check : prevent from mouse up without a hover
+                                               ex. doing always on top in hardkey area */
                                                if ( null != currentHoverRegion ) {
                                                        if ( currentHoverRegion.width == 0 && currentHoverRegion.height == 0 ) {
                                                                shell.redraw();
@@ -653,8 +654,10 @@ public class EmulatorSkin {
                                                        }
                                                }
 
+                                               SkinRegion region = SkinUtil.getHardKeyArea(e.x, e.y, currentRotationId, currentScale);
                                                if (keyCode != 101) { // TODO: not necessary for home key
-                                                       SkinUtil.trimShell(shell, currentImage);
+                                                       SkinUtil.trimShell(shell, currentImage,
+                                                                       region.x, region.y, region.width, region.height);
                                                }
 
                                                KeyEventData keyEventData = new KeyEventData(
index 67d944b..e38812a 100644 (file)
@@ -253,8 +253,8 @@ public class SkinUtil {
 
        }
 
-       public static void trimShell(Shell shell, Image image, int left, int top,
-               int width, int height) {
+       public static void trimShell(Shell shell, Image image,
+                       int left, int top, int width, int height) {
 
                if (null == image) {
                        return;
@@ -275,6 +275,8 @@ public class SkinUtil {
                                int alpha = imageData.getAlpha(i, j);
                                if (0 == alpha) {
                                        region.subtract(i, j, 1, 1);
+                               } else {
+                                       region.add(i, j, 1, 1);
                                }
                        }
                }