From 2a6158bae149e42caa8977c7f83e4a2406f5eb4c Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Thu, 29 May 2014 14:00:38 +0800 Subject: [PATCH] Create a test case for issue 4999(label is unsharp if it's created by smaller font). --- .../Classes/LabelTest/LabelTestNew.cpp | 21 ++++++++++++++++++- .../Classes/LabelTest/LabelTestNew.h | 11 ++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp index ea8aac728c..2facddeafa 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp @@ -78,7 +78,8 @@ static std::function createFunctions[] = CL(LabelTTFOldNew), CL(LabelFontNameTest), CL(LabelAlignmentTest), - CL(LabelIssue4428Test) + CL(LabelIssue4428Test), + CL(LabelIssue4999Test) }; #define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0])) @@ -1779,3 +1780,21 @@ std::string LabelIssue4428Test::subtitle() const { return "Reorder issue #4428.The label should be flipped vertically."; } + +LabelIssue4999Test::LabelIssue4999Test() +{ + auto label = Label::createWithTTF("Smaller font test", "fonts/arial.ttf",5); + label->setPosition(VisibleRect::center()); + label->setAnchorPoint(Vec2::ANCHOR_MIDDLE); + addChild(label); +} + +std::string LabelIssue4999Test::title() const +{ + return "New Label Bugs Test"; +} + +std::string LabelIssue4999Test::subtitle() const +{ + return "Reorder issue #4999.The label should be display cleanly."; +} diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h index 834d6fd5ff..beb1fc816d 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h @@ -496,6 +496,17 @@ public: virtual std::string subtitle() const override; }; +class LabelIssue4999Test : public AtlasDemoNew +{ +public: + CREATE_FUNC(LabelIssue4999Test); + + LabelIssue4999Test(); + + virtual std::string title() const override; + virtual std::string subtitle() const override; +}; + // we don't support linebreak mode #endif