diff --git a/frameworks/components/ui_abstract_scroll.cpp b/frameworks/components/ui_abstract_scroll.cpp index 82316bf4bf648b4992996de875310ab1407819fd..0aedca5edc4b9fe196bd12a255b1f9a32ab91293 100755 --- a/frameworks/components/ui_abstract_scroll.cpp +++ b/frameworks/components/ui_abstract_scroll.cpp @@ -73,7 +73,7 @@ private: } float bezielY = opa; bezielY = - Interpolation::GetBezierY(bezielY / OPA_OPAQUE, 0, BEZIER_CONTROL_POINT_Y_1, BEZIER_CONTROL_POINT_X_2, 1); + Interpolation::GetBezierY(bezielY / OPA_OPAQUE, BEZIER_CONTROL_POINT_X_1, 0, BEZIER_CONTROL_POINT_X_2, 1); opa = static_cast(bezielY * opa); if (scrollView_.yScrollBarVisible_) { scrollView_.yScrollBar_->SetOpacity(opa); @@ -114,7 +114,7 @@ private: } static constexpr uint16_t ANIMATOR_DURATION = 250; static constexpr uint16_t APPEAR_PERIOD = 2000; - static constexpr float BEZIER_CONTROL_POINT_Y_1 = 0.33f; + static constexpr float BEZIER_CONTROL_POINT_X_1 = 0.33f; static constexpr float BEZIER_CONTROL_POINT_X_2 = 0.67f; UIAbstractScroll& scrollView_; GraphicTimer timer_; diff --git a/frameworks/components/ui_slider.cpp b/frameworks/components/ui_slider.cpp index da4537a4fd5dcd52705fa7dd7ecf97192bb2bb1a..b5b2b5f432397b01a0c90dd143342e3ccaead158 100755 --- a/frameworks/components/ui_slider.cpp +++ b/frameworks/components/ui_slider.cpp @@ -120,30 +120,30 @@ void UISlider::SetKnobImage(const char* knobImage) void UISlider::DrawKnob(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea, const Rect& foregroundRect) { - int16_t halfKnobWidth = GetKnobWidth() >> 1; + int16_t halfKnobWidth = GetKnobWidth() / 2; // 2: half int16_t offset; Rect knobBar; switch (direction_) { case Direction::DIR_LEFT_TO_RIGHT: { - offset = (knobWidth_ - progressHeight_) >> 1; + offset = (knobWidth_ - progressHeight_) / 2; // 2: half knobBar.SetRect(foregroundRect.GetRight() - halfKnobWidth, foregroundRect.GetTop() - offset, foregroundRect.GetRight() + halfKnobWidth, foregroundRect.GetBottom() + offset); break; } case Direction::DIR_RIGHT_TO_LEFT: { - offset = (knobWidth_ - progressHeight_) >> 1; + offset = (knobWidth_ - progressHeight_) / 2; // 2: half knobBar.SetRect(foregroundRect.GetLeft() - halfKnobWidth, foregroundRect.GetTop() - offset, foregroundRect.GetLeft() + halfKnobWidth, foregroundRect.GetBottom() + offset); break; } case Direction::DIR_BOTTOM_TO_TOP: { - offset = (knobWidth_ - progressWidth_) >> 1; + offset = (knobWidth_ - progressWidth_) / 2; // 2: half knobBar.SetRect(foregroundRect.GetLeft() - offset, foregroundRect.GetTop() - halfKnobWidth, foregroundRect.GetRight() + offset, foregroundRect.GetTop() + halfKnobWidth); break; } case Direction::DIR_TOP_TO_BOTTOM: { - offset = (knobWidth_ - progressWidth_) >> 1; + offset = (knobWidth_ - progressWidth_) / 2; // 2: half knobBar.SetRect(foregroundRect.GetLeft() - offset, foregroundRect.GetBottom() - halfKnobWidth, foregroundRect.GetRight() + offset, foregroundRect.GetBottom() + halfKnobWidth); break;