提交 a86e05a5 编写于 作者: Y YueBiang

Description: fix codex bugs

IssueNo: https://gitee.com/openharmony/graphic_ui/issues/I448N2
Feature or Bugfix: Bugfix
Binary Source:No
Signed-off-by: NYueBiang <suyue7@huawei.com>
上级 c254e318
......@@ -275,12 +275,10 @@ void UIImageView::UpdateContentMatrix()
}
return;
}
// 2: the width should exclude the border-left and border-right, which equal borderwidth
int16_t widgetWidth = viewRect.GetWidth() -
style_->paddingLeft_ - style_->paddingRight_ - style_->borderWidth_ * 2;
// 2: the height should exclude the border-top and border-bottom, which equal borderwidth
int16_t widgetHeight = viewRect.GetHeight() -
style_->paddingTop_ - style_->paddingBottom_ - style_->borderWidth_ * 2;
int16_t widgetWidth = viewRect.GetWidth() - style_->paddingLeft_ - style_->paddingRight_ -
style_->borderWidth_ * 2; // 2: excludes the border-left and border-right
int16_t widgetHeight = viewRect.GetHeight() - style_->paddingTop_ - style_->paddingBottom_ -
style_->borderWidth_ * 2; // 2: excludes the border-top and border-bottom
float scaleX = static_cast<float>(widgetWidth) / static_cast<float>(imageWidth_);
float scaleY = static_cast<float>(widgetHeight) / static_cast<float>(imageHeight_);
......
......@@ -19,8 +19,8 @@
#include "compare_tools.h"
#include "test_resource_config.h"
#include "ui_auto_test.h"
#include "ui_test_group.h"
#include "ui_test.h"
#include "ui_test_group.h"
namespace OHOS {
#ifdef _WIN32
......
......@@ -550,7 +550,7 @@ void UITestImage::UIKit_UIImage_Test_Resize_001()
AddLable(480, g_height + 30, "Tiling mode"); // 480: position x; 30: increase y-coordinate
// 48: position x; 70: increase y-coordinate; 100: width and height
AddImageView(GetRect(48, g_height + 70, 100, 100), RED_IMAGE_PATH, false, UIImageView::ImageResizeMode::FILL);
// 160: position x; 70: increase y-coordinate; 100: width and height
// 160: position x; 70: increase y-coordinate; 100: width; 50: height
AddImageView(GetRect(160, g_height + 70, 100, 50), RED_IMAGE_PATH,
false, UIImageView::ImageResizeMode::CONTAIN);
// 320: position x; 70: increase y-coordinate; 100: width and height
......
......@@ -79,7 +79,7 @@ private:
UIImageView* AddImageView(const Rect rect, const char* src, bool autoEnable, UIImageView::ImageResizeMode mode);
Rect GetRect(int16_t x, int16_t y, int16_t w, int16_t h) const
{
return Rect(x, y, x + w , y + h);
return Rect(x, y, x + w, y + h);
}
};
} // namespace OHOS
......
......@@ -67,9 +67,9 @@ void UITestTransform::SetUp()
UICheckBox::UICheckBoxState::SELECTED);
AddRadioButton(GetRect(560, 90, 50, 50), // 560:position x 90:position y 50:width and height
"RB", new StateChangeListener(ImageScaleMode::FILL, this));
AddRadioButton(GetRect(560, 140, 50, 50), // 560:position x 90:position y 50:width and height
AddRadioButton(GetRect(560, 140, 50, 50), // 560:position x 140:position y 50:width and height
"RB", new StateChangeListener(ImageScaleMode::CONTAIN, this));
AddRadioButton(GetRect(560, 190, 50, 50), // 560:position x 90:position y 50:width and height
AddRadioButton(GetRect(560, 190, 50, 50), // 560:position x 190:position y 50:width and height
"RB", new StateChangeListener(ImageScaleMode::TILING, this));
}
......@@ -219,7 +219,6 @@ StateChangeListener::StateChangeListener(ImageScaleMode mode, UITestTransform* t
: mode_(mode),
testInstance_(testInstance)
{
}
bool StateChangeListener::OnChange(UICheckBox::UICheckBoxState state)
......@@ -233,7 +232,6 @@ bool StateChangeListener::OnChange(UICheckBox::UICheckBoxState state)
UITestRadioButton::UITestRadioButton(const char* name)
: UIRadioButton(name)
{
}
UITestRadioButton::~UITestRadioButton()
......
......@@ -366,7 +366,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_SetCurrentPage()
swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
swipe->SetPosition(TEXT_DISTANCE_TO_LEFT_SIDE, positionY_, g_swipeW, g_swipeH);
swipe->SetLoopState(loop_);
swipe->SetAnimatorTime(1000); // 100: mean animator drag time(ms)
swipe->SetAnimatorTime(1000); // 1000: mean animator drag time(ms)
currentSwipe_ = swipe;
container_->Add(swipe);
UIView* view1 = new UIView();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册