change scissor box event area
authorJisung Ahn <jcastle.ahn@samsung.com>
Wed, 24 Oct 2012 11:42:49 +0000 (20:42 +0900)
committerJisung Ahn <jcastle.ahn@samsung.com>
Wed, 24 Oct 2012 11:42:49 +0000 (20:42 +0900)
Change-Id: I7c63dbd05894573efeb757dbcd12ab1c60c8c4b0

widget/src/scissorbox/ScissorBox.cpp

index 6472842..745b3e4 100755 (executable)
@@ -809,7 +809,7 @@ public:
        };
 
 public:
-       CBox1() : CSelectBox(), EVENT_GRIP_SIZE(60), POT_SIZE(56,56), m_bMouseDown(false), m_bGripMouseDown(false)  { };
+       CBox1() : CSelectBox(), EVENT_GRIP_SIZE(90), POT_SIZE(56,56), m_bMouseDown(false), m_bGripMouseDown(false)  { };
 
        virtual ~CBox1() {
                MSG_HIGH("Remove CBox1");
@@ -1271,27 +1271,34 @@ public:
                evas_object_move(select_rect, mx, my);
                evas_object_resize(select_rect, mw, mh);
 
+               int w, h;
+
+               w = POT_SIZE.Width();
+               h = POT_SIZE.Height();
+
 // Event handle.
-               evas_object_resize(event_pot[0], EVENT_GRIP_SIZE, EVENT_GRIP_SIZE * 2);
-               evas_object_move(event_pot[0], m_rect.Left() - ( EVENT_GRIP_SIZE / 2), m_rect.Top() + m_rect.Height() / 2  - ( EVENT_GRIP_SIZE ));              // Left
+               evas_object_resize(event_pot[0], EVENT_GRIP_SIZE, EVENT_GRIP_SIZE);
+               evas_object_move(event_pot[0], m_rect.Left() - ( EVENT_GRIP_SIZE ) + w/2, m_rect.Top() + m_rect.Height() / 2  - ( EVENT_GRIP_SIZE / 2 ));               // Left
+
+               evas_object_resize(event_pot[1], EVENT_GRIP_SIZE, EVENT_GRIP_SIZE);
+               evas_object_move(event_pot[1], m_rect.Right() - w/2, m_rect.Top() + m_rect.Height() / 2 - ( EVENT_GRIP_SIZE / 2 ));             // Right
 
-               evas_object_resize(event_pot[1], EVENT_GRIP_SIZE, EVENT_GRIP_SIZE * 2);
-               evas_object_move(event_pot[1], m_rect.Right() - ( EVENT_GRIP_SIZE / 2), m_rect.Top() + m_rect.Height() / 2 - ( EVENT_GRIP_SIZE ));              // Right
+               evas_object_resize(event_pot[2], EVENT_GRIP_SIZE, EVENT_GRIP_SIZE);
+               evas_object_move(event_pot[2], m_rect.Left() + m_rect.Width() / 2 - ( EVENT_GRIP_SIZE / 2 ), m_rect.Top() - ( EVENT_GRIP_SIZE ) + h/2); // Top
 
-               evas_object_resize(event_pot[2], EVENT_GRIP_SIZE * 2, EVENT_GRIP_SIZE);
-               evas_object_move(event_pot[2], m_rect.Left() + m_rect.Width() / 2 - ( EVENT_GRIP_SIZE ), m_rect.Top() - ( EVENT_GRIP_SIZE / 2));        // Top
+               evas_object_resize(event_pot[3], EVENT_GRIP_SIZE, EVENT_GRIP_SIZE);
+               evas_object_move(event_pot[3], m_rect.Left() + m_rect.Width() / 2 - ( EVENT_GRIP_SIZE / 2 ), m_rect.Bottom() - h/2 );   // Bottom
 
-               evas_object_resize(event_pot[3], EVENT_GRIP_SIZE * 2, EVENT_GRIP_SIZE);
-               evas_object_move(event_pot[3], m_rect.Left() + m_rect.Width() / 2 - ( EVENT_GRIP_SIZE ), m_rect.Bottom() - ( EVENT_GRIP_SIZE / 2));     // Bottom
+#ifdef SHOW_EVENT_AREA
+               evas_object_color_set(event_pot[0], 255, 255, 255, 100);
+               evas_object_color_set(event_pot[1], 255, 255, 0, 100);
+               evas_object_color_set(event_pot[2], 255, 0, 255, 100);
+               evas_object_color_set(event_pot[3], 0, 255, 255, 100);
+#endif
 
                // Pot
                const int lw = 4;
                const int lh = 4;
-
-               int w, h;
-
-               w = POT_SIZE.Width();
-               h = POT_SIZE.Height();
 // L
                evas_object_resize(selector_pot[0], w, h);
                evas_object_move(selector_pot[0], m_rect.Left() - w / 2 + lw, m_rect.Top() + m_rect.Height() / 2 - h / 2 );