mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-10 04:09:31 +08:00
Apply suggestions from code review
Co-authored-by: Tushar Maheshwari <tushar27192@gmail.com>
This commit is contained in:
@@ -102,8 +102,8 @@ class ConstStringListRef {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const std::vector<std::string>* const ref_ = nullptr;
|
const std::vector<std::string>* ref_ = nullptr;
|
||||||
const std::vector<std::wstring>* const ref_wide_ = nullptr;
|
const std::vector<std::wstring>* ref_wide_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ftxui
|
} // namespace ftxui
|
||||||
|
@@ -16,9 +16,7 @@ Event Event::Character(std::string input) {
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
Event Event::Character(char c) {
|
Event Event::Character(char c) {
|
||||||
std::string input;
|
return Event::Character(std::string{c});
|
||||||
input += c;
|
|
||||||
return Event::Character(input);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
@@ -28,7 +28,7 @@ class Text : public Node {
|
|||||||
int y = box_.y_min;
|
int y = box_.y_min;
|
||||||
if (y > box_.y_max)
|
if (y > box_.y_max)
|
||||||
return;
|
return;
|
||||||
for (auto cell : Utf8ToGlyphs(text_)) {
|
for (const auto& cell : Utf8ToGlyphs(text_)) {
|
||||||
if (x > box_.x_max)
|
if (x > box_.x_max)
|
||||||
return;
|
return;
|
||||||
screen.PixelAt(x, y).character = cell;
|
screen.PixelAt(x, y).character = cell;
|
||||||
@@ -43,7 +43,7 @@ class Text : public Node {
|
|||||||
class VText : public Node {
|
class VText : public Node {
|
||||||
public:
|
public:
|
||||||
VText(std::string text) : text_(text) {
|
VText(std::string text) : text_(text) {
|
||||||
width_ = string_width(text_) ? 1 : 0;
|
width_{std::min(string_width(text_), 1)}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComputeRequirement() override {
|
void ComputeRequirement() override {
|
||||||
|
Reference in New Issue
Block a user