FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
automerge.cpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
2// このソースコードの使用は、LICENSEファイルにあるMITライセンスに準拠しています。
3#include <memory> // for make_shared
4#include <utility> // for move
5
6#include "ftxui/dom/elements.hpp" // for Element, automerge
7#include "ftxui/dom/node.hpp" // for Node
8#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
9#include "ftxui/screen/box.hpp" // for Box
10#include "ftxui/screen/screen.hpp" // for Pixel, Screen
11
12namespace ftxui {
13
14/// @brief 文字が近くの他の文字と自動的にマージされるようにします。
15/// @ingroup dom
17 class Impl : public NodeDecorator {
18 public:
19 using NodeDecorator::NodeDecorator;
20
21 void Render(Screen& screen) override {
22 for (int y = box_.y_min; y <= box_.y_max; ++y) {
23 for (int x = box_.x_min; x <= box_.x_max; ++x) {
24 screen.PixelAt(x, y).automerge = true;
25 }
26 }
27 Node::Render(screen);
28 }
29 };
30
31 return std::make_shared<Impl>(std::move(child));
32}
33
34} // namespace ftxui
Element automerge(Element child)
文字が近くの他の文字と自動的にマージされるようにします。
Definition automerge.cpp:16
Pixel & PixelAt(int x, int y)
指定された位置のセル (ピクセル) にアクセスします。
Definition image.cpp:41
bool automerge
Definition pixel.hpp:35
ピクセルの長方形グリッド。
Definition screen.hpp:25
FTXUI ftxui:: 名前空間
Definition animation.hpp:9
std::shared_ptr< Node > Element
Definition elements.hpp:21