Advertisement
cepxuozab

PathPropthTest

Apr 1st, 2024
652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.38 KB | None | 0 0
  1. void PathPropsTes() {
  2.     using namespace svg;
  3.     using namespace std::string_view_literals;
  4.     using namespace std::string_literals;
  5.  
  6.     class Tester : public PathProps<Tester> {
  7.     public:
  8.         Tester& setTestAttr() {
  9.             return *this;
  10.         }
  11.  
  12.         void Render(const RenderContext& context) const {
  13.             auto& out = context.out;
  14.             out << "<tester "sv;
  15.             RenderAttrs(out);
  16.             out << "/>"sv;
  17.         }
  18.     };
  19.     {
  20.         Tester().Render(std::cout);
  21.         std::cout << std::endl;
  22.     } {
  23.         Tester().SetStrokeColor("yellow"s)
  24.             .SetFillColor("green"s)
  25.             .setTestAttr()
  26.             .SetStrokeLineJoin(StrokeLineJoin::ROUND)
  27.             .SetStrokeLineCap(StrokeLineCap::ROUND)
  28.             .SetStrokeWidth(3)
  29.             .Render(std::cout);
  30.         std::cout << std::endl;
  31.     } {
  32.         Tester().SetFillColor("green"s)
  33.             .SetStrokeLineCap(StrokeLineCap::ROUND)
  34.             .SetStrokeLineJoin(StrokeLineJoin::ROUND)
  35.             .setTestAttr()
  36.             .SetStrokeWidth(3)
  37.             .SetStrokeColor("yellow"s)
  38.             .Render(std::cout);
  39.     }
  40.  
  41. }
  42. <tester />
  43. <tester />
  44. <tester fill="green" stroke="yellow" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
  45. <tester fill="green" stroke="yellow" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement