description {
state: "default" 0.0;
fixed: 1 1;
- min: 352 177;
+ min: 332 177;
align: 0.5 0.0;
visible: 1;
color: 0 0 0 0;
min: 146 177;
align: 0.0 0.0;
rel1 { relative: 0.0 0.0; to: "bg"; }
- rel2 { relative: 0.5 1.0; to: "bg"; offset: -20 -1;}
+ rel2 { relative: 0.0 1.0; to: "bg"; }
image {
normal: "magnifier_left.png";
border: 21 1 20 44;
max: 40 999999;
align: 0.0 0.0;
rel1 { relative: 1.0 0.0; to: "bg_left"; }
- rel2 { relative: 0.0 1.0; to: "bg_right"; }
+ rel2 { relative: 1.0 1.0; to: "bg"; }
image {
normal: "magnifier_middle.png";
- border: 0 40 20 44;
+ border: 0 0 20 44;
}
image.middle: 1;
fill.smooth: 0;
state: "default" 0.0;
fixed: 1 1;
min: 146 177;
- rel1 { relative: 0.5 0.0; to: "bg"; offset: 21 0;}
+ rel1 { relative: 1.0 0.0; to: "bg_middle";}
rel2.to: "bg";
image {
normal: "magnifier_right.png";
: m_viewImpl(viewImpl)
, m_image(0)
, m_magnifier(0)
- , m_width(320)
- , m_height(120)
+ , m_width(0)
+ , m_height(0)
+ , m_edjeWidth(0)
+ , m_edjeHeight(0)
{
}
evas_object_del(m_magnifier);
}
+static float s_widtheOffset = 32;
+static float s_heightOffset = 60;
+
void TextSelectionMagnifier::update(const IntPoint& point)
{
if (!m_magnifier) {
m_magnifier = elm_layout_add(topWidget);
elm_layout_file_set(m_magnifier, EDJE_DIR"/Magnifier.edj", "magnifier");
+
+ edje_object_part_geometry_get(elm_layout_edje_get(m_magnifier), "bg", 0, 0, &m_edjeWidth, &m_edjeHeight);
+
+ m_width = m_edjeWidth - s_widtheOffset;
+ m_height = m_edjeHeight - s_heightOffset;
}
int viewX, viewY, viewWidth, viewHeight;
static int s_magnifierMargin = 10;
static int s_magnifierOffsetY = 220;
+static int s_defaultEdjeHeight = 177;
void TextSelectionMagnifier::move(const IntPoint& point)
{
if (xPosition > viewWidth - (m_width / 2))
xPosition = viewWidth - (m_width / 2) - s_magnifierMargin;
- int yPosition = point.y() - s_magnifierOffsetY;
+ int yPosition = point.y() - ((float)s_magnifierOffsetY * ((float)m_edjeHeight / s_defaultEdjeHeight));
if (yPosition < (m_height / 2))
yPosition = m_height / 2;
if (yPosition > viewHeight - (m_height / 2))