FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
clear_under.cpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. 無断複写・転載を禁じます。
2// このソースコードの使用は、
3// LICENSEファイルにあるMITライセンスに従います。
4#include <memory> // for make_shared
5#include <utility> // for move
6
7#include "ftxui/dom/elements.hpp" // for Element, clear_under
8#include "ftxui/dom/node.hpp" // for Node
9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
10#include "ftxui/screen/box.hpp" // for Box
11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
12
13namespace ftxui {
14
15namespace {
16using ftxui::Screen;
17
18class ClearUnder : public NodeDecorator {
19 public:
21
22 void Render(Screen& screen) override {
23 for (int y = box_.y_min; y <= box_.y_max; ++y) {
24 for (int x = box_.x_min; x <= box_.x_max; ++x) {
25 screen.PixelAt(x, y) = Pixel();
26 screen.PixelAt(x, y).character = " "; // ピクセルが書き込まれたものと見なす。
27 }
28 }
29 Node::Render(screen);
30 }
31};
32} // namespace
33
34/// @brief |child|を描画する前に、下にあるピクセルをクリアします。これは、
35/// dboxと組み合わせて使用すると便利です。
36/// @see ftxui::dbox
37/// @ingroup dom
39 return std::make_shared<ClearUnder>(std::move(element));
40}
41
42} // namespace ftxui
NodeDecorator(Element child)
friend void Render(Screen &screen, Node *node, Selection &selection)
Definition node.cpp:96
Element clear_under(Element element)
|child|を描画する前に、下にあるピクセルをクリアします。これは、 dboxと組み合わせて使用すると便利です。
void Render(Screen &screen, const Element &element)
要素をftxui::Screenに表示します。
Definition node.cpp:84
ピクセルの長方形グリッド。
Definition screen.hpp:25
FTXUI ftxui:: 名前空間
Definition animation.hpp:9
std::shared_ptr< Node > Element
Definition elements.hpp:21