From: hyunjin816.lee Date: Wed, 25 Jun 2014 05:48:36 +0000 (+0900) Subject: skin: modify coordinate information in ScreenShotDialog X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~228^2^2~107^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62187984ad58344a1ac481ebcab11f266e62e66c;p=sdk%2Femulator%2Fqemu.git skin: modify coordinate information in ScreenShotDialog Change-Id: Ib6f752c909eae89a37eb7240568d43678024e9ce Signed-off-by: hyunjin816.lee --- diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java index abf487a0a0..921bee63e5 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java @@ -272,13 +272,34 @@ public class ScreenShotDialog { origin.y += canvasGrabPosition.y - e.y; scrollComposite.setOrigin(origin); } - int curX = e.x - CANVAS_MARGIN;; - int curY = e.y - CANVAS_MARGIN;; + int MaxWidth = 0, MaxHeight = 0; + scaleSize = scale.getSelection() - 3; + int curX = (int)((e.x - CANVAS_MARGIN) * Math.pow(2, -scaleSize)); + int curY = (int)((e.y - CANVAS_MARGIN) * Math.pow(2, -scaleSize)); + + /* checking Rotation */ + switch (skin.getEmulatorSkinState().getCurrentRotationId()) { + case SkinRotations.LANDSCAPE_ID: + case SkinRotations.REVERSE_LANDSCAPE_ID: + MaxWidth = skin.getEmulatorSkinState().getCurrentResolutionHeight(); + MaxHeight = skin.getEmulatorSkinState().getCurrentResolutionWidth(); + break; + case SkinRotations.PORTRAIT_ID: + case SkinRotations.REVERSE_PORTRAIT_ID: + default: + MaxWidth = skin.getEmulatorSkinState().getCurrentResolutionWidth(); + MaxHeight = skin.getEmulatorSkinState().getCurrentResolutionHeight(); + break; + } if (curX < 0) curX = 0; + else if (curX > MaxWidth) + curX = MaxWidth; if (curY < 0) curY = 0; + else if (curY > MaxHeight) + curY = MaxHeight; labelPoint.setText(" x : " + curX + ", y : " + curY + " "); labelPoint.update();