private:
_EditCopyPasteManager* __pCopyPasteManager;
Bitmap* __pMagnifierBitmap;
+ Bitmap* __pMagnifierMaskBitmap;
_VisualElement* __pRoot;
int __handlerCursorPos;
FloatRectangle __windowBounds;
_EditCopyPasteMagnifier::_EditCopyPasteMagnifier(_EditCopyPasteManager* pCopyPasteManager, int handlerCursorPos)
: __pCopyPasteManager(pCopyPasteManager)
, __pMagnifierBitmap(null)
+ , __pMagnifierMaskBitmap(null)
, __pRoot(null)
, __handlerCursorPos(handlerCursorPos)
, __windowBounds(0.0f, 0.0f, 0.0f, 0.0f)
__pRoot->SetSurfaceOpaque(false);
GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_MAGNIFIER, BITMAP_PIXEL_FORMAT_ARGB8888, __pMagnifierBitmap);
+ GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_MAGNIFIER_MASK, BITMAP_PIXEL_FORMAT_ARGB8888, __pMagnifierMaskBitmap);
}
_EditCopyPasteMagnifier::~_EditCopyPasteMagnifier(void)
delete __pMagnifierBitmap;
__pMagnifierBitmap = null;
}
+ if (__pMagnifierMaskBitmap)
+ {
+ delete __pMagnifierMaskBitmap;
+ __pMagnifierMaskBitmap = null;
+ }
}
Bitmap*
GET_SHAPE_CONFIG(EDIT::COPYPASTE_MAGNIFIER_WIDTH, orientation, width);
GET_SHAPE_CONFIG(EDIT::COPYPASTE_MAGNIFIER_HEIGHT, orientation, height);
- bounds = FloatRectangle(cursorPoint.x - width/2, cursorPoint.y - height, width, height);
+ bounds = FloatRectangle(cursorPoint.x - width/2.0f, cursorPoint.y - height, width, height);
if (bounds.y < 0.0f)
{
bounds.y = 0.0f;
pCanvas->DrawBitmap(pCanvas->GetBoundsF(), *__pMagnifierBitmap);
}
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pMagnifierMaskBitmap))
+ {
+ Color editColor = __pCopyPasteManager->GetEdit()->GetColor(EDIT_STATUS_HIGHLIGHTED);
+ if (editColor.GetAlpha() == 0x00)
+ {
+ editColor.SetAlpha(0xFF);
+ }
+
+ Bitmap* pReplacedMaskBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pMagnifierMaskBitmap, Color::GetColor(COLOR_ID_MAGENTA), editColor);
+ SysTryReturnVoidResult(NID_UI_CTRL, pReplacedMaskBitmap, GetLastResult(), "pReplacedMaskBitmap is null.");
+
+ pCanvas->DrawNinePatchedBitmap(pCanvas->GetBoundsF(), *pReplacedMaskBitmap);
+ }
+ else
+ {
+ pCanvas->DrawBitmap(pCanvas->GetBoundsF(), *__pMagnifierMaskBitmap);
+ }
+
CaptureTextArea(*pCanvas);
delete pCanvas;
FloatRectangle textObjectBounds = pEditPresenter->GetTextBoundsF();
captureBounds.x = cursorBounds.x - captureWidth/2.0f;
- captureBounds.y = cursorBounds.y + cursorBounds.height/2 - captureHeight/2;
+ captureBounds.y = cursorBounds.y + cursorBounds.height/2.0f - captureHeight/2.0f;
captureBounds.width = captureWidth;
captureBounds.height = captureHeight;
captureBounds = textObjectBounds.GetIntersection(captureBounds);
SysTryReturnVoidResult(NID_UI_CTRL, pOriginalBitmp, E_INVALID_STATE, "pOriginalBitmp is null.");
Bitmap bitmap;
- r = bitmap.Construct(captureBounds);
+ r = bitmap.Construct(FloatRectangle(0, 0, captureBounds.width, captureBounds.height));
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
r = bitmap.Merge(FloatPoint(0.0f, 0.0f), *pOriginalBitmp, captureBounds);
void
_EditCopyPasteMagnifier::MoveMagnifier(const FloatPoint& point, int handlerCursorPos)
{
- FloatRectangle bounds = FloatRectangle(point.x - GetBoundsF().width/2, point.y - GetBoundsF().height, GetBoundsF().width, GetBoundsF().height);
+ FloatRectangle bounds = FloatRectangle(point.x - GetBoundsF().width/2.0f, point.y - GetBoundsF().height, GetBoundsF().width, GetBoundsF().height);
__handlerCursorPos = handlerCursorPos;
if (bounds.y < 0.0f)
{
DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_RIGHT_NORMAL, 11)
DECLARE_IMAGE_CONFIG(COPY_PASTE_SEARCH_ICON, 12)
DECLARE_IMAGE_CONFIG(COPY_PASTE_MAGNIFIER, 13)
- DECLARE_IMAGE_CONFIG(BG_ROUND_NORMAL, 14)
- DECLARE_IMAGE_CONFIG(BG_ROUND_EFFECT, 15)
- DECLARE_IMAGE_CONFIG(CLEAR_ICON_NORMAL, 16)
- DECLARE_IMAGE_CONFIG(CLEAR_ICON_PRESSED, 17)
- DECLARE_IMAGE_CONFIG(CLEAR_ICON_DISABLED, 18)
- DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_NORMAL, 19)
- DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, 20)
- DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_NORMAL, 21)
- DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_NORMAL, 22)
- DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_NORMAL, 23)
- DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_NORMAL, 24)
- DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_NORMAL, 25)
- DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_NORMAL, 26)
- DECLARE_IMAGE_CONFIG(BG_RING_FOCUSED, 27)
+ DECLARE_IMAGE_CONFIG(COPY_PASTE_MAGNIFIER_MASK, 14)
+ DECLARE_IMAGE_CONFIG(BG_ROUND_NORMAL, 15)
+ DECLARE_IMAGE_CONFIG(BG_ROUND_EFFECT, 16)
+ DECLARE_IMAGE_CONFIG(CLEAR_ICON_NORMAL, 17)
+ DECLARE_IMAGE_CONFIG(CLEAR_ICON_PRESSED, 18)
+ DECLARE_IMAGE_CONFIG(CLEAR_ICON_DISABLED, 19)
+ DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_NORMAL, 20)
+ DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, 21)
+ DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_NORMAL, 22)
+ DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_NORMAL, 23)
+ DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_NORMAL, 24)
+ DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_NORMAL, 25)
+ DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_NORMAL, 26)
+ DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_NORMAL, 27)
+ DECLARE_IMAGE_CONFIG(BG_RING_FOCUSED, 28)
DECLARE_DIMENSION_CONFIG(MIN_SIZE, 1)
DECLARE_DIMENSION_CONFIG(TITLE_STYLE_MIN_SIZE, 2)
ADD_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_RIGHT_NORMAL, #copy&paste_Handler_left_reverse.png);
ADD_IMAGE_CONFIG(COPY_PASTE_SEARCH_ICON, #copy&paste_icon_search.png);
ADD_IMAGE_CONFIG(COPY_PASTE_MAGNIFIER, #copy&paste_Magnifier.#.png);
+ ADD_IMAGE_CONFIG(COPY_PASTE_MAGNIFIER_MASK, #copy&paste_Magnifier_mask.#.png);
ADD_IMAGE_CONFIG(BG_ROUND_NORMAL, #00_edit_field_round_bg.#.png);
ADD_IMAGE_CONFIG(BG_ROUND_EFFECT, #00_edit_field_line_round_bg_01.#.png);
ADD_IMAGE_CONFIG(CLEAR_ICON_NORMAL, #00_edit_field_clear.png);
ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_WIDTH, 324);
ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_HEIGHT, 164);
ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_CAPTURE_WIDTH, 192);
- ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_CAPTURE_HEIGHT, 69);
+ ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_CAPTURE_HEIGHT, 70);
ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_CAPTURE_POSITION_X, 18);
ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_CAPTURE_POSITION_Y, 18);