@@ -12,6 +12,7 @@ RenderTextureTests::RenderTextureTests()
12
12
ADD_TEST_CASE (RenderTextureTargetNode);
13
13
ADD_TEST_CASE (SpriteRenderTextureBug);
14
14
ADD_TEST_CASE (RenderTexturePartTest);
15
+ ADD_TEST_CASE (Issue16113Test);
15
16
};
16
17
17
18
/* *
@@ -698,3 +699,39 @@ std::string SpriteRenderTextureBug::subtitle() const
698
699
{
699
700
return " Touch the screen. Sprite should appear on under the touch" ;
700
701
}
702
+
703
+
704
+ //
705
+ // Issue16113Test
706
+ //
707
+ Issue16113Test::Issue16113Test ()
708
+ {
709
+ auto s = Director::getInstance ()->getWinSize ();
710
+
711
+ // Save Image menu
712
+ MenuItemFont::setFontSize (16 );
713
+ auto item1 = MenuItemFont::create (" Save Image" , [&](Ref* ref){
714
+ auto winSize = Director::getInstance ()->getVisibleSize ();
715
+ auto text = Label::createWithTTF (" hello world" , " fonts/Marker Felt.ttf" , 40 );
716
+ text->setTextColor (Color4B::RED);
717
+ auto target = RenderTexture::create (winSize.width , winSize.height , Texture2D::PixelFormat::RGBA8888);
718
+ target->beginWithClear (0 ,0 ,0 ,0 );
719
+ text->setPosition (winSize.width / 2 ,winSize.height /2 );
720
+ text->Node ::visit ();
721
+ target->end ();
722
+ target->saveToFile (" issue16113.png" , Image::Format::PNG);
723
+ });
724
+ auto menu = Menu::create (item1, nullptr );
725
+ this ->addChild (menu);
726
+ menu->setPosition (s.width /2 , s.height /2 );
727
+ }
728
+
729
+ std::string Issue16113Test::title () const
730
+ {
731
+ return " Github Issue 16113" ;
732
+ }
733
+
734
+ std::string Issue16113Test::subtitle () const
735
+ {
736
+ return " aaa.png file without white border on iOS" ;
737
+ }
0 commit comments