FTXUI
7.0.3
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
// Use of this source code is governed by the MIT license that can be found in
3
// the LICENSE file.
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 Cell, Screen
12
13
namespace
ftxui
{
14
15
/// @brief Permet aux caractères d'être fusionnés automatiquement avec d'autres à proximité.
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.CellAt(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
elements.hpp
ftxui::automerge
Element automerge(Element child)
Permet aux caractères d'être fusionnés automatiquement avec d'autres à proximité.
Definition
automerge.cpp:17
ftxui
L'espace de noms FTXUI ftxui::
Definition
animation.hpp:11
ftxui::Element
std::shared_ptr< Node > Element
Definition
elements.hpp:25
ftxui::y
int y
Definition
elements.hpp:134
node.hpp
node_decorator.hpp
screen.hpp