From 73001eac11433a940b5bc09c9cbcaa3a2d172505 Mon Sep 17 00:00:00 2001 From: Myung Jin Kim Date: Thu, 4 Apr 2013 20:33:48 +0900 Subject: [PATCH] apply float draw Change-Id: I30589c5e64ca47ba6aa79237e0b855db3f4a3ebe --- src/ui/controls/FUiCtrl_ButtonPresenter.cpp | 100 +++++++++++------------ src/ui/controls/FUiCtrl_CheckButtonPresenter.cpp | 81 +++++++++--------- src/ui/controls/FUiCtrl_LabelPresenter.cpp | 8 +- src/ui/controls/FUiCtrl_ToolbarPresenter.cpp | 14 ++-- 4 files changed, 95 insertions(+), 108 deletions(-) diff --git a/src/ui/controls/FUiCtrl_ButtonPresenter.cpp b/src/ui/controls/FUiCtrl_ButtonPresenter.cpp index a3c05bc..4bb295f 100644 --- a/src/ui/controls/FUiCtrl_ButtonPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ButtonPresenter.cpp @@ -356,25 +356,24 @@ _ButtonPresenter::DrawBackground(void) { if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBackgroundEffectBitmap)) // 9,9 { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundBitmap); if (__pButton->IsUserBackgroundEffectBitmap(status)) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); } } else // 9,0 { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundBitmap); if (__pButton->IsUserBackgroundEffectBitmap(status)) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF())); } } } else // 9, X { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundBitmap); } } else // pBackgroundBitmap is not 9 @@ -383,28 +382,24 @@ _ButtonPresenter::DrawBackground(void) { if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBackgroundEffectBitmap)) // 0, 9 { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundBitmap->GetWidthF(), pBackgroundBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pBackgroundBitmap, FloatRectangle(0.0f, 0.0f, pBackgroundBitmap->GetWidthF(), pBackgroundBitmap->GetHeightF())); if (__pButton->IsUserBackgroundEffectBitmap(status)) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); } } else // 0, 0 { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundBitmap->GetWidthF(), pBackgroundBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pBackgroundBitmap, FloatRectangle(0.0f, 0.0f, pBackgroundBitmap->GetWidthF(), pBackgroundBitmap->GetHeightF())); if (__pButton->IsUserBackgroundEffectBitmap(status)) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF())); } } } else // 0, X { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundBitmap->GetWidthF(), pBackgroundBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pBackgroundBitmap, FloatRectangle(0.0f, 0.0f, pBackgroundBitmap->GetWidthF(), pBackgroundBitmap->GetHeightF())); } } } @@ -426,15 +421,15 @@ _ButtonPresenter::DrawBackground(void) { if (__pButton->IsUserBackgroundEffectBitmap(status)) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); } } else // X, 0 { if (__pButton->IsUserBackgroundEffectBitmap(status)) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, + FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF())); } } } @@ -483,19 +478,19 @@ _ButtonPresenter::DrawBackground(void) { if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBackgroundEffectBitmap)) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); } else { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); + pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); + pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, + FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF())); } } else { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); } } else @@ -504,22 +499,22 @@ _ButtonPresenter::DrawBackground(void) { if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBackgroundEffectBitmap)) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pReplacementColorBackgroundBitmap->GetWidthF(), pReplacementColorBackgroundBitmap->GetHeightF()))); - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); + pCanvas->DrawBitmap(bounds, *pReplacementColorBackgroundBitmap, + FloatRectangle(0.0f, 0.0f, pReplacementColorBackgroundBitmap->GetWidthF(), pReplacementColorBackgroundBitmap->GetHeightF())); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); } else { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pReplacementColorBackgroundBitmap->GetWidthF(), pReplacementColorBackgroundBitmap->GetHeightF()))); - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pReplacementColorBackgroundBitmap, + FloatRectangle(0.0f, 0.0f, pReplacementColorBackgroundBitmap->GetWidthF(), pReplacementColorBackgroundBitmap->GetHeightF())); + pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, + FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF())); } } else { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pReplacementColorBackgroundBitmap->GetWidthF(), pReplacementColorBackgroundBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pReplacementColorBackgroundBitmap, + FloatRectangle(0.0f, 0.0f, pReplacementColorBackgroundBitmap->GetWidthF(), pReplacementColorBackgroundBitmap->GetHeightF())); } } } @@ -529,12 +524,12 @@ _ButtonPresenter::DrawBackground(void) { if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBackgroundEffectBitmap)) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); } else { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, + FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF())); } } else @@ -600,12 +595,12 @@ _ButtonPresenter::DrawToolbarItemBackground(void) if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pToolbarItemBackgroundBitmap)) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pToolbarItemBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pToolbarItemBackgroundBitmap); } else { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pToolbarItemBackgroundBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pToolbarItemBackgroundBitmap->GetWidthF(), pToolbarItemBackgroundBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pToolbarItemBackgroundBitmap, + FloatRectangle(0.0f, 0.0f, pToolbarItemBackgroundBitmap->GetWidthF(), pToolbarItemBackgroundBitmap->GetHeightF())); } delete pCanvas; @@ -648,22 +643,21 @@ _ButtonPresenter::DrawBitmap(void) if (__pButton->GetSizeF().width - __pButton->GetBitmapPositionF(status).x - rightTouchMargin < pBitmap->GetWidthF() || __pButton->GetSizeF().height - __pButton->GetBitmapPositionF(status).y - bottomTouchMargin < pBitmap->GetHeightF()) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBitmap->GetWidthF(), pBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pBitmap, FloatRectangle(0.0f, 0.0f, pBitmap->GetWidthF(), pBitmap->GetHeightF())); if (pEffectBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pEffectBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pEffectBitmap->GetWidthF(), pEffectBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pEffectBitmap, + FloatRectangle(0.0f, 0.0f, pEffectBitmap->GetWidthF(), pEffectBitmap->GetHeightF())); } } else { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(__pButton->GetBitmapPositionF(status)), *pBitmap); + pCanvas->DrawBitmap(__pButton->GetBitmapPositionF(status), *pBitmap); if (pEffectBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(__pButton->GetEffectBitmapPositionF(status)), *pEffectBitmap); + pCanvas->DrawBitmap(__pButton->GetEffectBitmapPositionF(status), *pEffectBitmap); } } } @@ -680,22 +674,20 @@ _ButtonPresenter::DrawBitmap(void) if (__pButton->GetSizeF().width - __pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL).x - rightTouchMargin < pNormalBitmap->GetWidthF() || __pButton->GetSizeF().height - __pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL).y - bottomTouchMargin < pNormalBitmap->GetHeightF()) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pNormalBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pNormalBitmap->GetWidthF(), pNormalBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pNormalBitmap, FloatRectangle(0.0f, 0.0f, pNormalBitmap->GetWidthF(), pNormalBitmap->GetHeightF())); if (pNormalEffectBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pNormalEffectBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pNormalEffectBitmap->GetWidthF(), pNormalEffectBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pNormalEffectBitmap, FloatRectangle(0.0f, 0.0f, pNormalEffectBitmap->GetWidthF(), pNormalEffectBitmap->GetHeightF())); } } else { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(__pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL)), *pNormalBitmap); + pCanvas->DrawBitmap(__pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL), *pNormalBitmap); if (pNormalEffectBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(__pButton->GetEffectBitmapPositionF(_BUTTON_STATUS_NORMAL)), *pNormalEffectBitmap); + pCanvas->DrawBitmap(__pButton->GetEffectBitmapPositionF(_BUTTON_STATUS_NORMAL), *pNormalEffectBitmap); } } } @@ -832,12 +824,12 @@ _ButtonPresenter::DrawToolbarSelectedBitmap(void) if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pToolbarSelectedBitmap)) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pToolbarSelectedBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pToolbarSelectedBitmap); } else { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pToolbarSelectedBitmap, - _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pToolbarSelectedBitmap->GetWidthF(), pToolbarSelectedBitmap->GetHeightF()))); + pCanvas->DrawBitmap(bounds, *pToolbarSelectedBitmap, + FloatRectangle(0.0f, 0.0f, pToolbarSelectedBitmap->GetWidthF(), pToolbarSelectedBitmap->GetHeightF())); } delete pCanvas; diff --git a/src/ui/controls/FUiCtrl_CheckButtonPresenter.cpp b/src/ui/controls/FUiCtrl_CheckButtonPresenter.cpp index 47b61ac..82a8a33 100644 --- a/src/ui/controls/FUiCtrl_CheckButtonPresenter.cpp +++ b/src/ui/controls/FUiCtrl_CheckButtonPresenter.cpp @@ -244,18 +244,18 @@ _CheckButtonPresenter::DrawBackground(void) __pCheckButton->GetColor(CHECK_BUTTON_STATUS_NORMAL)); if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); } if (pBackgroundNormalEffectBitmap) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundNormalEffectBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundNormalEffectBitmap); } } else { if (pBackgroundBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pBackgroundBitmap); + pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBackgroundBitmap); } } } @@ -275,18 +275,18 @@ _CheckButtonPresenter::DrawBackground(void) __pCheckButton->GetColor(CHECK_BUTTON_STATUS_DISABLED)); if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); } if (pBackgroundNormalEffectBitmap) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundNormalEffectBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundNormalEffectBitmap); } } else { if (pBackgroundBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pBackgroundBitmap); + pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBackgroundBitmap); } } } @@ -306,18 +306,18 @@ _CheckButtonPresenter::DrawBackground(void) __pCheckButton->GetColor(CHECK_BUTTON_STATUS_PRESSED)); if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); } if (pBackgroundPressedEffectBitmap) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundPressedEffectBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundPressedEffectBitmap); } } else { if (pBackgroundBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pBackgroundBitmap); + pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBackgroundBitmap); } } } @@ -337,18 +337,18 @@ _CheckButtonPresenter::DrawBackground(void) __pCheckButton->GetColor(CHECK_BUTTON_STATUS_HIGHLIGHTED)); if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); } if (pBackgroundNormalEffectBitmap) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundNormalEffectBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundNormalEffectBitmap); } } else { if (pBackgroundBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pBackgroundBitmap); + pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBackgroundBitmap); } } } @@ -402,7 +402,7 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pMarkBgNormalBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y)), *pMarkBgNormalBitmap); + pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgNormalBitmap); } if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON) @@ -412,15 +412,15 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorBackgroundBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorBackgroundBitmap); } if (pCircleNormalEffectBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pCircleNormalEffectBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap); } if (pReplacementColorTextBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorTextBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorTextBitmap); } } } @@ -430,7 +430,7 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pMarkBgPressedBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y)), *pMarkBgPressedBitmap); + pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgPressedBitmap); } if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON) @@ -440,15 +440,15 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorBackgroundBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorBackgroundBitmap); } if (pCirclePressedEffectBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pCirclePressedEffectBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap); } if (pReplacementColorTextBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorTextBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorTextBitmap); } } } @@ -466,15 +466,15 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorBackgroundBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorBackgroundBitmap); } if (pCircleNormalEffectBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pCircleNormalEffectBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap); } if (pReplacementColorTextBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorTextBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorTextBitmap); } } } @@ -487,15 +487,15 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorBackgroundBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorBackgroundBitmap); } if (pCirclePressedEffectBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pCirclePressedEffectBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap); } if (pReplacementColorTextBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorTextBitmap); + pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorTextBitmap); } } } @@ -510,7 +510,7 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pOnOffBgNormalBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y)), *pOnOffBgNormalBitmap); + pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgNormalBitmap); } } else if (checkStatus == CHECK_BUTTON_STATUS_PRESSED) @@ -519,13 +519,13 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pOnOffBgPressedBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y)), *pOnOffBgPressedBitmap); + pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgPressedBitmap); } } if (__pCheckButton->IsSelected() && pOnOffBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y)), *pOnOffBitmap); + pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBitmap); } } else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER) @@ -543,13 +543,13 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pOnOffSlidingOnBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y)), *pOnOffSlidingOnBitmap); + pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingOnBitmap); } if (pOnOffSlidingHandlerBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - handlerMargin - handlerWidth, - __onOffSlidingButtonBounds.y - handlerMargin)), *pOnOffSlidingHandlerBitmap); + pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - handlerMargin - handlerWidth, + __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingHandlerBitmap); } } else @@ -559,12 +559,12 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pOnOffSlidingOffBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y)), *pOnOffSlidingOffBitmap); + pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingOffBitmap); } if (pOnOffSlidingHandlerBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__onOffSlidingButtonBounds.x + handlerMargin, __onOffSlidingButtonBounds.y - handlerMargin)), *pOnOffSlidingHandlerBitmap); + pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x + handlerMargin, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingHandlerBitmap); } } @@ -1179,18 +1179,13 @@ _CheckButtonPresenter::DrawMarkAnimation(void) } Bitmap* pMarkBitmap = __pCheckButton->GetMarkBitmap(); - //CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle(); - //if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON - // || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON) + if (__pCheckButton->IsSelected() && pMarkBitmap) { - if (__pCheckButton->IsSelected() && pMarkBitmap) - { - FloatRectangle sourceRect(0.0f, 0.0f, pMarkBitmap->GetWidthF() * __ratio * 0.1, pMarkBitmap->GetHeightF()); - FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkBitmap->GetWidthF() * __ratio * 0.1, pMarkBitmap->GetHeightF()); + FloatRectangle sourceRect(0.0f, 0.0f, pMarkBitmap->GetWidthF() * __ratio * 0.1, pMarkBitmap->GetHeightF()); + FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkBitmap->GetWidthF() * __ratio * 0.1, pMarkBitmap->GetHeightF()); - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(destRect), *pMarkBitmap, _CoordinateSystemUtils::ConvertToInteger(sourceRect)); - } + pCanvas->DrawBitmap(destRect, *pMarkBitmap, sourceRect); } delete pCanvas; diff --git a/src/ui/controls/FUiCtrl_LabelPresenter.cpp b/src/ui/controls/FUiCtrl_LabelPresenter.cpp index 2bd02f7..acc10a6 100644 --- a/src/ui/controls/FUiCtrl_LabelPresenter.cpp +++ b/src/ui/controls/FUiCtrl_LabelPresenter.cpp @@ -279,22 +279,22 @@ _LabelPresenter::DrawBackground(void) if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBitmap)) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBitmap); } else { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pBitmap); + pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBitmap); } if (pEffectBitmap != null) { if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pEffectBitmap)) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pEffectBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pEffectBitmap); } else { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pEffectBitmap); + pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pEffectBitmap); } } } diff --git a/src/ui/controls/FUiCtrl_ToolbarPresenter.cpp b/src/ui/controls/FUiCtrl_ToolbarPresenter.cpp index 52208cc..bf647a1 100644 --- a/src/ui/controls/FUiCtrl_ToolbarPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ToolbarPresenter.cpp @@ -805,7 +805,7 @@ _ToolbarPresenter::DrawItems(void) if (pTitleIcon) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(usableArea.x, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2)), *(pTitleIcon)); + pCanvas->DrawBitmap(FloatPoint(usableArea.x, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2), *(pTitleIcon)); __titleRect.x = usableArea.x + pTitleIcon->GetWidthF() + usableArea.x; __titleRect.y = headerTopMargin + (titleDisplayHeight - titleHeight) / 2; @@ -859,7 +859,7 @@ _ToolbarPresenter::DrawItems(void) leftMargin = __titleRect.width - titleTextDimension.width - leftMargin * 3; } - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2)), *(pTitleIcon)); + pCanvas->DrawBitmap(FloatPoint(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2), *(pTitleIcon)); if (__pToolbar->GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_TITLE) != ANIMATION_STOPPED) { @@ -910,7 +910,7 @@ _ToolbarPresenter::DrawItems(void) leftMargin = leftMargin + usableArea.width - (pTitleIcon->GetWidthF() + processingAnimationIconGap + processingAnimationIconSize); } - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2)), *(pTitleIcon)); + pCanvas->DrawBitmap(FloatPoint(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2), *(pTitleIcon)); __pToolbar->SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_TITLE, leftMargin + processingAnimationIconGap + processingAnimationIconSize, @@ -934,7 +934,7 @@ _ToolbarPresenter::DrawItems(void) leftMargin = usableArea.width - pTitleIcon->GetWidthF(); } - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2)), *(pTitleIcon)); + pCanvas->DrawBitmap(FloatPoint(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2), *(pTitleIcon)); } else { @@ -1841,7 +1841,7 @@ _ToolbarPresenter::TimerForTitleSlideTimeout(void) if (__pTitleBackgroundBitmap) { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(__titleRect), *__pTitleBackgroundBitmap); + pCanvas->DrawBitmap(__titleRect, *__pTitleBackgroundBitmap); } if (__pTitleTextObject->IsChanged()) @@ -1992,12 +1992,12 @@ _ToolbarPresenter::SetBouncingVisualElement(float startX, float startY) { if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pBouncingEffectBitmap)) { - pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(rect), *__pBouncingEffectBitmap); + pCanvas->DrawNinePatchedBitmap(rect, *__pBouncingEffectBitmap); } else { - pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(rect), *__pBouncingEffectBitmap); + pCanvas->DrawBitmap(rect, *__pBouncingEffectBitmap); } } -- 2.7.4