FTXUI
6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
automerge.cpp
Go to the documentation of this file.
1
// 版權所有 2020 Arthur Sonzogni. 保留所有權利。
2
// 本源代碼受 MIT 許可證約束,該許可證可在
3
// LICENSE 文件中找到。
4
#include <memory>
// for make_shared
5
#include <utility>
// for move
6
7
#include "
ftxui/dom/elements.hpp
"
// for Element, automerge
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
13
namespace
ftxui
{
14
15
/// @brief 啟用字符自動與附近其他字符合併。
16
/// @ingroup dom
17
Element
automerge
(
Element
child) {
18
class
Impl :
public
NodeDecorator
{
19
public
:
20
using
NodeDecorator::NodeDecorator;
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).
automerge
=
true
;
26
}
27
}
28
Node::Render(screen);
29
}
30
};
31
32
return
std::make_shared<Impl>(std::move(child));
33
}
34
35
}
// namespace ftxui
box.hpp
ftxui::NodeDecorator
Definition
node_decorator.hpp:16
elements.hpp
ftxui::automerge
Element automerge(Element child)
啟用字符自動與附近其他字符合併。
Definition
automerge.cpp:17
Render
void Render(Screen &screen, const Element &element)
在 ftxui::Screen 上顯示元素。
Definition
node.cpp:82
ftxui::Image::PixelAt
Pixel & PixelAt(int x, int y)
存取給定位置的單元格 (Pixel)。
Definition
image.cpp:43
ftxui::Pixel::automerge
bool automerge
Definition
pixel.hpp:35
ftxui::Screen
像素的矩形網格。
Definition
screen.hpp:26
ftxui
FTXUI 的 ftxui:: 命名空間
Definition
animation.hpp:10
ftxui::Element
std::shared_ptr< Node > Element
Definition
elements.hpp:22
node.hpp
node_decorator.hpp
screen.hpp